Last post Feb 11, 2014 02:57 PM by JORGEMAL
Feb 07, 2014 11:25 AM|JORGEMAL|LINK
I am trying to send an email from a web form. The email service in our company is offered by the ISP (using our domain name) so I talked to them to get the correct information about how to contact the host (email server). The code I use to send the email
is shown below but I get a timeout exception. Employees in our company use MS Outlook to send/receive email so I double checked the parameters and they are the same the ISP gave me.
SmtpClient objSmtpClient = new SmtpClient();
objSmtpClient.Host = "the ISP email server here";
objSmtpClient.Port = 465;
objSmtpClient.EnableSsl = true;
objSmtpClient.Credentials = new System.Net.NetworkCredential("an email account here", "password here");
I have already tried several workarounds I have found searching the Internet without success.
I will very much appreciate your feedback.
Feb 09, 2014 09:46 PM|Starain chen - MSFT|LINK
Thanks for your post!
Please try to specify the TimeOut time, such as:
objSmtpClient.Timeout = 20000;
There is a link may benefit you:
# Send Mail / Contact Form using ASP.NET and C#
Feb 11, 2014 02:57 PM|JORGEMAL|LINK
I had tried the timeout setting without success, also I have reviewed a lot of articles and basically they all say about the same. What I did is to use a library from www.afterlogic.com instead of system.net.mail
and I could send emails.