I wrote the following code in my code file. But this will not work ... plz help me! :)
protected void Button1_Click(object sender, EventArgs e) { MailMessage msgeme = new MailMessage(" someone@example.com ", " someone@example.com ", "subject", "body"); SmtpClient smtpclient = new SmtpClient("smtp.gmail.com",587); smtpclient.EnableSsl = true; smtpclient.Send(msgeme); smtpclient.Credentials = new NetworkCredential(" someone@example.com ", "password"); }
I tried both 587 and 465. Bt shows an SMTP exception handler error. Can anyone help?
source share