Question timed out when sending email

reedone816

Member
Joined
Mar 18, 2013
Messages
6
Programming Experience
Beginner
Hi I got this error:
system.net.mail.smtpexception the operation has timed out
VB.NET:
        Dim mail As New System.Net.Mail.MailMessage()
        Dim cred As New System.Net.NetworkCredential("yyy@yyy.com", "password")
        mail.[To].Add("xxx@xxx.com)
        mail.Subject = "subject"
        mail.From = New System.Net.Mail.MailAddress("yyy@yyy.com")
        mail.IsBodyHtml = True
        mail.Body = "message"
        Dim smtp As New System.Net.Mail.SmtpClient("smtp.mailserver.com")
        smtp.UseDefaultCredentials = False
        smtp.EnableSsl = True
        smtp.Credentials = cred
        smtp.Port = 25
        smtp.Timeout = 20000

        'bypassing security/turning it off
        Net.ServicePointManager.ServerCertificateValidationCallback = Function(s As Object, certificate As X509Certificate, chain As X509Chain, sslPolicyErrors As SslPolicyErrors) True

        smtp.Send(mail)

in the development machine (windows server 2003) it works. but when I run it in application pc (windows xp) it is throwing error.

anyone can help?
 
Back
Top