Search code examples
c#asp.netasp.net-mvcemailmicrosoft-exchange

Using To or CC when sending mail from C# - What's better in performance sense?


I'm working on functionality which sends e-mails to user and/or partners (with attachments etc.) via Microsoft Exchange using ASP.NET MVC.

I've this dilemma: What's better for performance - Adding all e-mail recipients as ToRecipients or CcRecipients in EmailMessage class?

Message content is same for all, which means that everybody gets attachments etc. So does in case of multiple "To" recipients system send multiple e-mail messages? Also, when using CC for all recipients does it mean that only one mail is sent to multiple addresses?

My main concern is memory usage for these attachments which can get to max 30 MB per e-mail.

Thanks.


Solution

  • CC (carbon copy) shouldn't be used in place of the 'To' field on an email.

    You wouldn't (normally) want to email one person and CC the remaining recipients as this is not how the field is intended to be used.

    From a performance POV it should have no impact

    EDIT:

    Might I just add an addition to my previous answer, whilst from a performance perspective there is no difference. There may be cases where you would want to BCC people on emails. I.e. large external email chains.

    In some cases, adding lets say 100 people into the 'To' field would be an issue because each recipient will gain access to 99 other people's personal email addresses.

    It would be better in this instance to add each person to BCC (so they can't see each other) or to email each recipient individually.