How to bulk email with attachment using c#.net

// include the below two namescapces


Using System.Net;
Using System.Net.Mail;



_mMailServer = "122.166.13.31"; // your servrer ip address
_mPort = 25; // your port number

objMessage = new MailMessage();


Attachment attach = new Attachment(UpldProdImage1.PostedFile.FileName);


SmtpClient objSmtpClient = new SmtpClient(_mMailServer, 25);//, 25

objSmtpClient.UseDefaultCredentials = true;


MailAddress mfrom = new MailAddress(txtFrom.Text, "GSS Admin");

objMessage.To.Add(Convert.ToString(to address list); // adding all the recpients to the "TO" list

objMessage.From = mfrom;
objMessage.Subject = txtSubject.Text;
objMessage.Body = txtBody.Text;
objMessage.Attachments.Add(attach);
objSmtpClient.Send(objMessage);



Reference: http://dotnetvyas.blogspot.com/2008/11/send-bulk-email-with-attachment-in.html


Attachments

  • Send bulk email with attachment in asp.net2.0 (23193-29113-Send bulk email with attachment in asp.doc)
  • Comments

    Author: venkatesan.M26 May 2009 Member Level: Gold   Points : 1

    Are you sure this is concept of sending bulk email concept .. i think this is not..???

    Author: Danasegarane.A28 May 2009 Member Level: Gold   Points : 2

    The thing is that in this line


    bjMessage.To.Add(Convert.ToString(to address list); // adding all the recpients to the "TO" list


    could be like

    Dim toMailids as string="test@test.com,test3@test.com"
    bjMessage.To.Add(toMailids)


    That is join the Mail id using either by ; or ,

    Author: Hania11 Dec 2013 Member Level: Bronze   Points : 0

    You can achieve this task with .NET Library from Aspose. Try it :

    http://www.aspose.com/.net/email-component.aspx



  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: