Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string subject = Subject.Text;
- string body = "Name : " + Name.Text + "rn" + "Phone : " + Phone.Text + "rn" + Message.Text;
- var mail = new MailMessage();
- var smtpServer = new SmtpClient("smtp.gmail.com", 587);
- mail.From = new MailAddress("veezo2007pk@gmail.com");
- mail.To.Add("veezo2007pk@gmail.com");
- mail.Subject = subject;
- mail.Body = body;
- //var attachment= new System.Net.Mail.Attachment;
- // mail.Attachments.Add(attachment);
- smtpServer.Credentials = new NetworkCredential("veezo2007pk@gmail.com", "123");
- smtpServer.UseDefaultCredentials = false;
- smtpServer.EnableSsl = true;
- smtpServer.Send(mail);
Add Comment
Please, Sign In to add comment