469,917 Members | 1,724 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,917 developers. It's quick & easy.

How can you write a smtp client which can send email to a hotmail account?

Hi,
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("ZZ*@CCC.com", "XXX");
MailAddress to = new MailAddress("SS*@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 = "ZZ*@CCC.com"
objMessage.To = "SS*@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.

Sep 21 '06 #1
1 2730
Let me clarify a little bit, I am not going to talk with hotmail
straightly. I am going to talk a SMTP server which will relay my email
to hotmail. And as I said, I am sure that my SMTP server was not
blocked because I can use Outlook to send email to an hotmail account
through my SMTP server.

Sep 21 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by venky | last post: by
7 posts views Thread by oopsbabies | last post: by
6 posts views Thread by Jonathan Wood | last post: by
4 posts views Thread by Brian | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.