sendgrid/sendgrid-java — pull request #28 by lkobashigawa (2014-06-05 21:28:29+00:00)
Title: Change addTo() to generate the 'to' parameter instead of 'to' property on x-smtpapi parameter

I ran into a problem with sendgrid not sending BCC emails when the x-smtpapi header is used for the 'to' recipients.

This change puts recipients added via addTo() to the 'to' parameter and adds a new method to allow the caller to choose to add recipients to the x-smtpapi parameter.

For the caller to get the old default behavior where the 'from' address is used for the 'to' parameter and recipients are added to x-smtpapi the caller would do:

email = new SendGrid.Email();
email.addTo(fromAddress);
email.addSmtpApiTo(toAddress);