Unable to emails through my account in gmail

B

Bur3001

Hello everybody,
I have a windows app with errors reporting feature. When a user of my
app finds a bug or so, he/she can send me an email reporting that
problem.

The problem started to show up four or five days ago, an exception
gets thrown stating that "The SMTP server requires a secure connection
or the client was not authenticated. The server response was: 5.5.1
Authentication Required".

Then I did some modifications on the code then I got the this
exception "The server response was: 5.7.0 Must issue a STARTTLS
command first"

And the situation got even worst, NOW the smtp.google.com server
doesn't respond.

And there's the code:-
System.Net.Mail.MailMessage msg = new System.Net.Mail.MailMessage();
msg.To.Add("(e-mail address removed)");
msg.From = new
System.Net.Mail.MailAddress("(e-mail address removed)", "Error
reporting", System.Text.Encoding.UTF8);
msg.Subject = "Reporting a bug";
msg.SubjectEncoding = System.Text.Encoding.UTF8;
msg.Body = "Test message" +

msg.BodyEncoding = System.Text.Encoding.UTF8;
msg.IsBodyHtml = false;
msg.Priority = MailPriority.High;

//Add the Creddentials
SmtpClient client = new SmtpClient();

client.Credentials = new
System.Net.NetworkCredential("(e-mail address removed)", "MyPassword");
client.Port = 587;// I also tried ports 25 and
465
client.Host = "smtp.google.com";
client.EnableSsl = true;


//you can also call client.Send(msg)
client.SendAsync(msg);


thanks in advance.
 
B

Bras

Try to use the smtp.gmail.com server and make sure SSL is turned on in the
advanced sending options, also change the SMTP port to 587 and turn on
authentication, use same settings as receiving e-mail and then make sure the
receiving ID is your full Gmail e-mail address.
And for the receiving server ... you may want to use pop.gmail.com or
imap.gmail.com depending which type of account you have setup.

Bras
 
B

Bur3001

On 27thanks a lot Bras
the problem is solved by only changing the server name to
smtp.gmail.com


I really Appreciate your useful help
thanks again
 

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

Top