I have made a mailsender in C#.but the program does a error when I run it.
this is my code:
MailMessage mail=new MailMessage("shahidi83am@gmail.com","shahidi83am@yahoo.com","subject","this is a test");
SmtpClient smtp =new SmtpClient("smtp.gmail.com");
smtp.Port=587;
smtp.Credentials= new System.Net.NetworkCredential("username","pass");
smtp.Send(mail);
and this is the error:
System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Must issue a STARTTLS command first. 79sm6578238wrc.34 - gsmtp