SmtpClient sc = new SmtpClient("smpt.live.com");
Your SMTP server name is likely wrong. Should probably be smtp.live.com
.
Question
I am trying to make an email sender by C#. I have used System.Net.Mail
to do that. But after doing all the thing when I am going to send the mail using SmtpClient
's Send()
method it throws me exception. why?
code is here
MailMessage mail = new MailMessage("wtushar_09@live.com", "wtushar09@gmail.com");
SmtpClient sc = new SmtpClient("smpt.live.com");
sc.Port = 587;
sc.Credentials = new System.Net.NetworkCredential("wtushar_09@live.com", "************");
sc.EnableSsl = true;
sc.Send(mail);
MessageBox.Show("Mail sent", "done", MessageBoxButtons.OK);
exception is coming from sc.Send(mail);
Solution
SmtpClient sc = new SmtpClient("smpt.live.com");
Your SMTP server name is likely wrong. Should probably be smtp.live.com
.