Multiple Recipients Example

There are many situations where you wish to send the same email to multiple people, like sending an email about a sale you're having or the results of a competition.

With Easy Email For Mandrill you can send the same email to thousands of users, each user will receive an email with just their email address in the 'to' label.

You can even customise each email for each person, look at Mandrill Templates to see how.

Example

Contact Form
To
To
To
From
Subject
Message
Send Type


Step By Step For Mandrill

Step 1

First you need to follow the guide for integrating the DLL and setting up Easy Email at Setting Up.

To send emails to multiple people the easiest way is to create a list of their email addresses.

You can then simply pass this list into a new MandrillEmail object

Next all that is required is the below code, placed inside the click handler of the send button.

List<EasyEmailForMandrill.Recipient> to = new List<EasyEmailForMandrill.Recipient>() 
{ 
    new EasyEmailForMandrill.Recipient(txtTo.Text), 
    new EasyEmailForMandrill.Recipient(txtTo2.Text), 
    new EasyEmailForMandrill.Recipient(txtTo3.Text) 
};

EasyEmail.EmailMessage email = 
new EasyEmailForMandrill.MandrillEmail( to,
                                        txtFrom.Text, 
                                        txtSubject.Text, 
                                        txtMessage.Text);

EasyEmail.EasyEmailResponse response = email.Send();

lblOut.Text = "Easy Email response : " + response.Message;
            

Completed!

That's all you need to do to send an email to multiple people with Easy Email For Mandrill

Step By Step For SMTP

Step 1

First you need to follow the guide for integrating the DLL and setting up Easy Email at Setting Up.

To send emails to multiple people the easiest way is to create a list of their email addresses.

You can then simply pass this list into a new EasyEmail object

Next all that is required is the below code, placed inside the click handler of the send button.

List<string> to = new List<string>() 
{ 
    txtTo.Text, 
    txtTo2.Text, 
    txtTo3.Text 
};

EasyEmail.EmailMessage email = 
new EasyEmail.EmailMessage(to, txtFrom.Text, txtSubject.Text, txtMessage.Text);

EasyEmail.EasyEmailResponse response = email.Send();

lblOut.Text = "Easy Email response : " + response.Message;
            

Completed!

That's all you need to do to send an email to multiple people with Easy Email For Mandrill