Guest User

Untitled

a guest
May 8th, 2018
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. string subject = Subject.Text;
  2. string body = "Name : " + Name.Text + "rn" + "Phone : " + Phone.Text + "rn" + Message.Text;
  3. var mail = new MailMessage();
  4. var smtpServer = new SmtpClient("smtp.gmail.com", 587);
  5. mail.From = new MailAddress("veezo2007pk@gmail.com");
  6. mail.To.Add("veezo2007pk@gmail.com");
  7. mail.Subject = subject;
  8. mail.Body = body;
  9. //var attachment= new System.Net.Mail.Attachment;
  10. // mail.Attachments.Add(attachment);
  11. smtpServer.Credentials = new NetworkCredential("veezo2007pk@gmail.com", "123");
  12.  
  13. smtpServer.UseDefaultCredentials = false;
  14. smtpServer.EnableSsl = true;
  15. smtpServer.Send(mail);
Add Comment
Please, Sign In to add comment