Advertisement
Guest User

Untitled

a guest
Aug 27th, 2017
1,799
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. 5.5.4 Error: send AUTH command first
  2.  
  3. MailAddress from = new MailAddress("lady.occur@yandex.ru", "Tom");
  4. MailAddress to = new MailAddress("vasilisa.tcheremushkina@yandex.ru");
  5. MailMessage m = new MailMessage(from, to);
  6. m.Subject = "Тест";
  7. m.Body = "<h2>Письмо-тест работы smtp-клиента</h2>";
  8. m.IsBodyHtml = true;
  9. SmtpClient smtp = new SmtpClient("smtp.yandex.ru", 25);
  10. smtp.EnableSsl = true;
  11. smtp.Credentials = new NetworkCredential("lady.occur@yandex.ru", "X29Fgbf2nnwKCRaR");
  12. smtp.Send(m);
  13. MessageBox.Show("СМС ОТПРАВЛЕН");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement