Click here to Skip to main content
15,848,264 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi experts
i want to send an email using c# code it gives error like this

"The server encountered an error processing the request. The exception message is 'System.Net.Mail.SmtpException: Transaction failed. The server response was: Message rejected: Email address is not verified." i used from email and to email is gmail account emails

What can i do.. please help me..

Thnx in advance..
Posted
Updated 18-Feb-14 23:38pm
v2

1 solution

change your port in smtp client configuration:-
SmtpClient client = new SmtpClient("smtp.gmail.com");
client.Credentials = new NetworkCredential ("myEmail@gmail.com", "myPassword");
client.Port = 587;
client.EnableSsl = true;
client.Send(mail);

to
SmtpClient client = new SmtpClient("smtp.gmail.com");
client.Credentials = new NetworkCredential ("myEmail@gmail.com", "myPassword");
client.Port = 465;
client.EnableSsl = true;
client.Send(mail);
 
Share this answer
 
Comments
NaniCh 19-Feb-14 4:53am    
Thanks trushnak for giving reply.. i used my company smtp credentials.. not gmail smtp credentials but i used from email is "myemail@gmail.com" and to email also "myemail@gmail.com". i used this getting error.. i used different emails mail is sending successfully..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900