C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Code Snippets » Email »

How to bulk email with attachment using c#.net


Posted Date: 29 Nov 2008    Resource Type: Code Snippets    Category: Email
Author: PYK VYASMember Level: Bronze    
Rating: 1 out of 5Points: 10



// 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);



Attachments

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

    For more details, visit http://dotnetvyas.blogspot.com/2008/11/send-bulk-email-with-attachment-in.html



  • Responses

    Author: venkatesan    26 May 2009Member Level: Diamond   Points : 1
    Are you sure this is concept of sending bulk email concept .. i think this is not..???


    Author: Danasegarane.A    28 May 2009Member Level: Diamond   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 ,




    Feedbacks      
    Popular Tags   What are tags ?   Search Tags  
    Sign In to add tags.
    How to bulk email with attachment using c#.net  .  Email with attachment  .  

    Post Feedback


    This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
    You must Sign In to post a response.
    Next Resource: Sending Email Using ASP.Net and C#
    Previous Resource: Send Email using ASP.NET 2.0 and C#
    Return to Discussion Resource Index
    Post New Resource
    Category: Email


    Post resources and earn money!
     
    More Resources



    dotNet Slackers

    About Us    Contact Us    Privacy Policy    Terms Of Use