title: Sending batch emails using SMTP using MailGun
body: <p>Referring to this documentation:</p>
  
  <p><a href="https://documentation.mailgun.com/user_manual.html#batch-sending" rel="nofollow">https://documentation.mailgun.com/user_manual.html#batch-sending</a></p>
  
  <p>I am able to send emails to multiple recipients using the JSON api. </p>
  
  <p>However, my web application is also using <a href="http://aboutcode.net/postal/" rel="nofollow">Postal</a> for formatting emails and looks like Postal can use only SMTP for sending emails.</p>
  
  <p>I need to send personalized emails to many recipients in a single SMTP call. The problem is, I am not able to figure out how to specify "Recipient Variables" when using SMTP.</p>
  
  <p>I've tried adding the recipient variables to the SMTP header, but looks like Mailgun is not loving that.</p>
  
  <pre><code>MailMessage mail = new MailMessage("foo@sandboxce6d7987d87741098c67b8437378847d.mailgun.org", emails);
  mail.Subject = "Hello2";
  mail.Body = "Testing some Mailgun awesomness";           
  mail.Headers.Add("recipient_variables", jsonobjects);
  </code></pre>
  
  <p>How shall we specify "Recipient Variables" when using SMTP?
  Any help will be greatly appreciated. Thanks.</p>