GMail SMTP Outgoing Problem
Web Development
4
Posts
3
Posters
0
Views
1
Watching
-
In the following code snippet if I change the port number from 587 to any other (even to 465 as mentioned over the net) the mail sending attempts fail.
string from1 = "from\_e-mail"; string to1 = "to\_e-mail"; string subject = "Test"; const string password = "xxxxxxxx"; string body = "Hello World"; smtp.Host = "smtp.gmail.com"; smtp.Port = 587; smtp.EnableSsl = true; smtp.UseDefaultCredentials = false; smtp.DeliveryMethod = SmtpDeliveryMethod.Network; smtp.Credentials = new NetworkCredential(from1, password); smtp.Timeout = 20000000; smtp.Send(from1, to1, subject, body);
Any Suggestion
-
In the following code snippet if I change the port number from 587 to any other (even to 465 as mentioned over the net) the mail sending attempts fail.
string from1 = "from\_e-mail"; string to1 = "to\_e-mail"; string subject = "Test"; const string password = "xxxxxxxx"; string body = "Hello World"; smtp.Host = "smtp.gmail.com"; smtp.Port = 587; smtp.EnableSsl = true; smtp.UseDefaultCredentials = false; smtp.DeliveryMethod = SmtpDeliveryMethod.Network; smtp.Credentials = new NetworkCredential(from1, password); smtp.Timeout = 20000000; smtp.Send(from1, to1, subject, body);
Any Suggestion
The most important suggestion: Tell us the error message!
-
The most important suggestion: Tell us the error message!
The problem is that noting happens. I believe connection is not getting established.
-
In the following code snippet if I change the port number from 587 to any other (even to 465 as mentioned over the net) the mail sending attempts fail.
string from1 = "from\_e-mail"; string to1 = "to\_e-mail"; string subject = "Test"; const string password = "xxxxxxxx"; string body = "Hello World"; smtp.Host = "smtp.gmail.com"; smtp.Port = 587; smtp.EnableSsl = true; smtp.UseDefaultCredentials = false; smtp.DeliveryMethod = SmtpDeliveryMethod.Network; smtp.Credentials = new NetworkCredential(from1, password); smtp.Timeout = 20000000; smtp.Send(from1, to1, subject, body);
Any Suggestion