Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int row2 = e.RowIndex;
- string em = GridView1.Rows[row2].Cells[2].Text;
- MailUtility mu = new MailUtility();
- mu.SendMail(em, "thank you", "thank you");
- using System;
- using System.Data;
- using System.Configuration;
- using System.Web;
- using System.Web.Security;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Web.UI.WebControls.WebParts;
- using System.Web.UI.HtmlControls;
- using System.Net.Mail;
- using System.Net;
- using System.Net.Security;
- using System.Security.Cryptography.X509Certificates;
- /// <summary>
- /// Summary description for MailUtility
- /// </summary>
- public class MailUtility
- {
- public void SendMail(string sendTo, string subject, string body)
- {
- MailMessage m = new MailMessage();
- m.From = new MailAddress("BarBichachiSite@gmail.com",
- "אני");
- m.To.Add(new MailAddress(sendTo));
- m.Subject = subject;
- m.Body = body;
- SmtpClient sc = new SmtpClient();
- sc.EnableSsl = true;
- sc.Send(m);
- }
- <system.net>
- <mailSettings>
- <smtp>
- <network host="smtp.gmail.com" port="587" userName="BarBichachiSite@gmail.com" password="1234567d" />
- </smtp>
- </mailSettings>
- </system.net>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement