Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Net;
- using System.Net.Mail;
- namespace VoiceAssistant
- {
- class Mail
- {
- public void SendMail(string body, string addr)
- {
- StringFromRichTextBox Sfr = new StringFromRichTextBox();
- MailMessage mail = new MailMessage();
- SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com");
- mail.From = new MailAddress("rajesh331912@gmail.com");
- mail.To.Add(addr);
- mail.Subject = "Messege from Rajesh";
- mail.Body = body;
- SmtpServer.Port = 587;
- SmtpServer.Credentials = new System.Net.NetworkCredential("rajesh331912", "5%A/9Yc+/@j,_jS");
- SmtpServer.EnableSsl = true;
- SmtpServer.Send(mail);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement