|
ms
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Problems when writing a SMTP client and talk with the hotmailFirst I am not trying to write a client to talk with hotmail straightly. I am trying to write some codes to send emails through a SMTP server. I wrote a C++ version using pure socket programming and SMTP protocol, a VB version using CDO and a C# version using System.Net.Mail. Now all of them works great with any email account but hotmail. So here is the C# code: MailAddress from = new MailAddress("Z***@CCC.com", "XXX"); MailAddress to = new MailAddress("S***@hotmail.com", "YYY"); MailMessage mail = new MailMessage(from, to); mail.Subject = "Test only, please don't block me"; mail.Body = "Test only, please don't block me"; SmtpClient client = new SmtpClient("xxx.xxx.xxx.xxx"); client.Send(mail); here is the VB Code: Set objMessage = CreateObject("CDO.Message") objMessage.Subject = "Test only, please don't block me" objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "xxx.xxx.xxx.xxx" objMessage.From = "Z***@CCC.com" objMessage.To = "S***@hotmail.com" objMessage.TextBody = "Test only, please don't block me" objMessage.Send I wouldn't put C++ code here because it's too long. 1. I can use Outlook to send out email (on the same machine where my code runs) and hotmail will receive it with no problem. So I know my SMTP server was not blocked by Hotmail. 2. My SMTP server doesn't require authentication, I know it's bad. But I can't change that. 3. Somebody told me that I would need some strange header to make the hotmail like my email. Therefore I set up a sniffer and get all headers which are used by Outlook. I used all of them in my C++ code but it still doesn't work. Now this hotmail problem drives me crazy and I have wasted 4 hours on it with no clue. Can anybody help me out of here? Thanks Ou P.S It's a little bit ironic to see that MS' product doesn't work well on its own product. <oliu***@gmail.com> wrote in message
Show quoteHide quote news:1158890022.311651.287040@m7g2000cwm.googlegroups.com... Sending mail to an hotmail recipient is exactly like sending to any other | Hi, | First I am not trying to write a client to talk with hotmail | straightly. I am trying to write some codes to send emails through a | SMTP | server. I wrote a C++ version using pure socket programming and SMTP | protocol, a VB version using CDO and a C# version using | System.Net.Mail. Now all of them works great with any email account but | | hotmail. So here is the C# code: | | MailAddress from = new MailAddress("Z***@CCC.com", "XXX"); | MailAddress to = new MailAddress("S***@hotmail.com", | "YYY"); | | | MailMessage mail = new MailMessage(from, to); | | | mail.Subject = "Test only, please don't block me"; | mail.Body = "Test only, please don't block me"; | | | SmtpClient client = new SmtpClient("xxx.xxx.xxx.xxx"); | client.Send(mail); | | | here is the VB Code: | Set objMessage = CreateObject("CDO.Message") | objMessage.Subject = "Test only, please don't block me" | objMessage.Configuration.Fields.Item _ | ("http://schemas.microsoft.com/cdo/configuration/smtpserver") | | = "xxx.xxx.xxx.xxx" | objMessage.From = "Z***@CCC.com" | objMessage.To = "S***@hotmail.com" | objMessage.TextBody = "Test only, please don't block me" | objMessage.Send | | | I wouldn't put C++ code here because it's too long. | | | 1. I can use Outlook to send out email (on the same machine where | my code runs) and hotmail will receive it with no problem. So I know my | | SMTP server was not blocked by Hotmail. | 2. My SMTP server doesn't require authentication, I know it's bad. | | But I can't change that. | 3. Somebody told me that I would need some strange header to make | the hotmail like my email. Therefore I set up a sniffer and get all | headers which are used by Outlook. I used all of them in my C++ code | but it still doesn't work. | | | Now this hotmail problem drives me crazy and I have wasted 4 | hours on it with no clue. Can anybody help me out of here? | | | Thanks | Ou | | | P.S It's a little bit ironic to see that MS' product doesn't work | well on its own product. | mail recipient, all you are doing is sending mail to your SMTP server, point. Your SMTP server will find out how to forward the mail to hotmail (which uses SMTP anyway) or whatever. Without seeing your complete code, it's nearly impossible to tell you what's wrong, all I can say is that: - you must be sure that xxx.xxx.xxx.xxx corresponds to your smtp host. SmtpClient client = new SmtpClient("xxx.xxx.xxx.xxx"); - your display name (XXX) must be correct as it overrides the address.... MailAddress from = new MailAddress("Z***@CCC.com", "XXX"); just try using only the address. Willy. Here's someone elses views :
http://www.velocityreviews.com/forums/t100989-smtp-email-problem.html HTH Ciaran O'Donnell Show quoteHide quote "oliu***@gmail.com" wrote: > Hi, > First I am not trying to write a client to talk with hotmail > straightly. I am trying to write some codes to send emails through a > SMTP > server. I wrote a C++ version using pure socket programming and SMTP > protocol, a VB version using CDO and a C# version using > System.Net.Mail. Now all of them works great with any email account but > > hotmail. So here is the C# code: > > MailAddress from = new MailAddress("Z***@CCC.com", "XXX"); > MailAddress to = new MailAddress("S***@hotmail.com", > "YYY"); > > > MailMessage mail = new MailMessage(from, to); > > > mail.Subject = "Test only, please don't block me"; > mail.Body = "Test only, please don't block me"; > > > SmtpClient client = new SmtpClient("xxx.xxx.xxx.xxx"); > client.Send(mail); > > > here is the VB Code: > Set objMessage = CreateObject("CDO.Message") > objMessage.Subject = "Test only, please don't block me" > objMessage.Configuration.Fields.Item _ > ("http://schemas.microsoft.com/cdo/configuration/smtpserver") > > = "xxx.xxx.xxx.xxx" > objMessage.From = "Z***@CCC.com" > objMessage.To = "S***@hotmail.com" > objMessage.TextBody = "Test only, please don't block me" > objMessage.Send > > > I wouldn't put C++ code here because it's too long. > > > 1. I can use Outlook to send out email (on the same machine where > my code runs) and hotmail will receive it with no problem. So I know my > > SMTP server was not blocked by Hotmail. > 2. My SMTP server doesn't require authentication, I know it's bad. > > But I can't change that. > 3. Somebody told me that I would need some strange header to make > the hotmail like my email. Therefore I set up a sniffer and get all > headers which are used by Outlook. I used all of them in my C++ code > but it still doesn't work. > > > Now this hotmail problem drives me crazy and I have wasted 4 > hours on it with no clue. Can anybody help me out of here? > > > Thanks > Ou > > > P.S It's a little bit ironic to see that MS' product doesn't work > well on its own product. > >
OSQL UserName and PWd
There has to be a better way to work withat string chars Nice exceptions. How do I copy datatable from one dataset to another. Username & Password as parameters Caching Help Needed Starfield How to shutdown open network ports? unsafe bug ? How to Convert SHDocVw.WebBrowser to System.Windows.Forms.WebBrowser |
|||||||||||||||||||||||