Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void Send(string login, string password , string mailSend, string subject , string body , string proxyHost, int proxyPort)
- {
- SmtpClient smtp = new SmtpClient("smtp.mail.ru", 587);
- smtp.Credentials = new System.Net.NetworkCredential(login, password);
- MailMessage mail = new MailMessage();
- mail.From = new MailAddress(login);
- mail.To.Add(new MailAddress(mailSend));
- mail.Subject = subject;
- mail.Body = body;
- smtp.EnableSsl = true;
- smtp.Send(mail);
- }
- var smtp = new SmtpConnection();
- smtp.Proxy = new HttpProxy("ip-адрес", 8080);
- smtp.Connect("smtp.mail.ru", 587);
- smtp.ExtendedHello("mail.ru");
- smtp.StartTls("mail.ru");
- smtp.ExtendedHello("mail.ru");
- smtp.AuthPlain("mail_acc", "password");
- smtp.Mail("mail_acc@mail.ru");
- smtp.Recipient("recipient@gmail.com");
- smtp.Data(EmailFormatter.GetText("Bill Gates <mail_acc@mail.ru>", "Subject", "Steve Jobs <recipient@gmail.com>", "Hello"));
- //smtp.Data(EmailFormatter.GetHtml("Bill Gates <mail_acc@mail.ru>", "Subject", "Steve Jobs <recipient@gmail.com>", "<h1>Hello!</h1><a href='stackoverflow.com'>click!</a>"));
- smtp.Quit();
Add Comment
Please, Sign In to add comment