Saturday, August 11, 2018

Bulk Email Sending with Specific File


Bulk Email  sending

protected void Button7_Click(object sender, EventArgs e)
{
foreach (ListItem item in this.ListBox2.Items)
{


if (item.Selected)
{


MailMessage mail = new MailMessage();
mail.To.Add(new MailAddress(item.Text));
mail.From = new MailAddress("email");
mail.Subject = "Happy Ganesh 2014";

mail.Body = TextBox4.Text;

mail.Attachments.Add(new Attachment(FileUpload1.FileContent,

System.IO.Path.GetFileName(FileUpload1.FileName)));

mail.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.gmail.com"; //Or Your SMTP Server Address


smtp.Credentials = new System.Net.NetworkCredential("email", "pass");

smtp.EnableSsl = true;
smtp.Send(mail);
}

}
}


4 comments:

  1. I Find it very interesting and supportive. Thanks for sharing such great information. hope you keep sharing such kind of information Email Bulk Software

    ReplyDelete
  2. This code is really important thanks for sharing this.
    mass mailer software is one which you need when you send bulk emails.

    ReplyDelete
  3. Good content and nice blog. Thanks for sharing

    such great information. hope you keep sharing such

    kind of information Advance Bulk Mailer

    ReplyDelete

  4. Thanks for sharing this blog ! such a great blog !
    Bulk Email Software

    ReplyDelete

GRIDVIEW ON ROW DATA BOUND EVENT

 Database Create  Student : roll , name , city , cost  Fix 6 Value  in Database Record  ====================================================...