1
@Nilesh Shah Thankyou so much its working :-)
1
login to your gmail account and do this setting:
https://www.google.com/settings/security/lesssecureapps
1
it's simple spelling mistake. it is smtp, you have written smpt
this line
- SmtpClient tsmtpClient = new SmtpClient("smpt.gmail.com", 587);
should be changed to :
- SmtpClient tsmtpClient = new SmtpClient("smtp.gmail.com", 587);
0
Thank you so much. I changed into "smtp".
then i got an error like this.
Server Error in '/' Application.
The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. Learn more at
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. Learn more at
Source Error:
Line 66: //pass account information to the sender Line 67: tsmtpClient.Credentials = new System.Net.NetworkCredential("foodcaloriecalculator@gmail.com", "kasuchin321"); Line 68: tsmtpClient.Send(tmailmessage); Line 69: Line 70: