Monday, March 26, 2012

setting smtp server port

hi all, my sevres mail serve is Imail and they have blocked mail relay, and i use IIS smtp server, for sending mails via .net cuz they have blocked relay on IMail.

every thing was ok, till our server is upgraded to win2k3, right now when i navigate to page that sends mail i get this error:

System.Runtime.InteropServices.COMException: The transport failed to connect to the server.
can any one help me, i think i should mention smtp port via .net message object, and i did not find any property for that.
Best Regards,
Arash Nowrouzi

the win2k3 machine has to be running the SMTP server - set up through IIS manager i believe
HTH

thanks for your reply,

i've already done that, but port number has chnaged form 25 to 2599, to avoid confict with my mail server smtp service,

any idea?
best regards,
Arshak


check out this link - systemwebmail.com has everything concerning sending mail with .Net
http://systemwebmail.com/faq/2.9.aspx
specifically you need to add this line
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "your port number");
SmtpMail.SmtpServer = "mail.mycompany.com";
SmtpMail.Send(mail);
HTH

0 comments:

Post a Comment