Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Web; using System.Net; using System.Net.Mail;
- using System.Net.Mime;
- SmtpClient Smtp = new SmtpClient("smtp.gmail.com", 587); // 587 это порт
- Smtp.Credentials = new NetworkCredential("login", "password");
- //Формирование письма
- MailMessage Message = new MailMessage();
- Message.From = new MailAddress("from@ok.com"); //от кого
- Message.To.Add(new MailAddress("to@ok.com")); // кому
- Message.Subject = "Заголовок"; Message.Body = "Сообщение"; Smtp.Send(Message);//отправка
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement