![]() |
| ||
| sending email Hi all I have been trying to send email from my asp.net website using c#. the code runs without any errors, but when i click the send button i get this error. /*System.Net.Mail.SmtpException: Failure sending mail.---> System.Net.WebException: Unable to connect to remote server -->System.net.sockets.socketException: a connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond at System.Net.Sockets.Socket.EndConnect(IAsyscResult asyncResult)*/ ------------------------------------------------------------------ I heard that McAffee OAS blocks emails from going out but i have disabled it in my computer. Can you please help in eliminating this error. |
| ||
| Re: sending email Check, if your mail client is created in this way ? System.Net.Mail.SmtpClient mailClient = new SmtpClient("your.smtp.server", 25); System.Net.NetworkCredential nc = new System.Net.NetworkCredential("YourLogin", "YourPassword"); mailClient.Credentials = nc; And also check address of your SMTP server, login and password, if they are all correct. Or there may be also problems at server side. |
| ||
| Re: sending email here is the code i used System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage(); |
| ||
| Re: sending email But are you sure that smtp.Port must be 587 but not 25 ? Usually SMTP port is 25 (that is why I have prescribed 25 in SmtpClient constructor). If it is 587, then replace 25 into 587 in that line. Try also with smtp.EnableSsi = false. |
| All times are GMT -4. The time now is 8:14 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC