Gmail SMTP

  • Thread starter Alexander Vasilevsky
  • Start date
A

Alexander Vasilevsky

Code below after some pause raise exception "waiting times operations has
expired". Why?

public static void Send(string from, string pwd, string to, string subject,
string body)

{

MailMessage message = new MailMessage(from, to);

message.Subject = subject;

message.Body = body;

int port = 465;

SmtpClient client = new SmtpClient("smtp.gmail.com", port);

client.Credentials = new NetworkCredential(from, pwd);

client.EnableSsl = true;

client.Send(message);

}

http://www.alvas.net - Audio tools for C# and VB.Net developers + Christmas
discount
 
C

coolCoder

Code below after some pause raise exception "waiting times operations has
expired". Why?

public static void Send(string from, string pwd, string to, string subject,
string body)

{

MailMessage message = new MailMessage(from, to);

message.Subject = subject;

message.Body = body;

int port = 465;

SmtpClient client = new SmtpClient("smtp.gmail.com", port);

client.Credentials = new NetworkCredential(from, pwd);

client.EnableSsl = true;

client.Send(message);

}

http://www.alvas.net- Audio tools for C# and VB.Net developers + Christmas
discount

Do you have any external program blocking the connection ? For example
- Fire wall, anti-virus or some other application. Do you have network
policies set which does not allow connections from programs other than
those allowed ?
And a simple but important question, have you enabled POP access in
the gmail account ?
Check these and I think you will be done.
By the way, code doesn't look like culprit.
 
A

Alexander Vasilevsky

Do you have any external program blocking the connection ? For example
- Fire wall, anti-virus or some other application. Do you have network
No

policies set which does not allow connections from programs other than
those allowed ?
No

And a simple but important question, have you enabled POP access in
the gmail account ?
Yes

Check these and I think you will be done.
By the way, code doesn't look like culprit.

http://www.alvas.net - Audio tools for C# and VB.Net developers + Christmas
discount
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Failure to Send email 1
Help Please-- Failure sending Email 1
SMTP MailMessage MailAddressCollection 2
Send Email in ASP.net 4
SmtpClient Problem 4
C# - Email problems 2
System.Net.Mail and SSL 1
SMTP Sending Issue 6

Top