Simple Example

This is the easiest way to send an email with Easy Email For Mandrill For Mandrill.

Example

Contact Form
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 For Mandrill at Setting Up.

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

protected void btnSend_Click(object sender, EventArgs e)
{
  //Create the recipient
  EasyEmailForMandrill.Recipient recipient =
  new EasyEmailForMandrill.Recipient(txtTo.Text);

   EasyEmailForMandrill.MandrillEmail email = 
   new EasyEmailForMandrill.MandrillEmail( recipient, 
                                           txtFrom.Text, 
                                           txtSubject.Text, 
                                           txtMessage.Text);


    EasyEmail.EasyEmailResponse response = email.Send();

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

Completed!

That's all you need to do to send an email 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 For Mandrill at Setting Up.

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

protected void btnSend_Click(object sender, EventArgs e)
{
   EasyEmail.EmailMessage email = 
   new EasyEmail.EmailMessage(txtTo.Text, txtFrom.Text,
   txtSubject.Text, txtMessage.Text);

    EasyEmail.EasyEmailResponse response = email.Send();

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

Completed!

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