locked
email distribution to only BCC filed not for CC field RRS feed

  • General discussion

  • Once document is uploaded email is going to all registered users so for every document nearly emails are going for 5000 registered users ..  so there is lot of network consumption is taking for every article upload so , Now we have to change it to only the users who appears in BCC field they only has to get email distribution not for all registered users in cc trying with differtent tips but no time plz suggest how i need to go further

    Tuesday, July 5, 2011 7:34 AM

All replies

  • Depending on where you are doing this.

    I am not sure where you are doing this from.

    However, if it is from the object model point of view, 

    This ASP.NET code should work:

    MailMessage message = new MailMessage();

    message.From = new MailAddress(sender@foo.bar.com);

    message.BCC.Add(new MailAddress(recipient1@foo.bar.com));

    message.BCC.Add(new MailAddress(recipient2@foo.bar.com));

    message.BCC.Add(new MailAddress(recipient3@foo.bar.com));

    message.BCC.Add(new MailAddress(carboncopy@foo.bar.com));

    message.Subject = "This is my subject";

    message.Body = "This is the content";

    SmtpClient client = new SmtpClient(); 

    client.Send(message);

     or use theSharePoint SPUtility.SendEmail Method and build a string concatenation of email on the to parameter on the bcc address.


    delakti
    Tuesday, August 2, 2011 1:18 PM