Sunday, 11 August 2013

Is it possible to store html on an smtp server , and reference it for bulk mailing as body?

Is it possible to store html on an smtp server , and reference it for bulk
mailing as body?

Using .net, I'm creating a mailing app, that uses Amazon SES. Amazon
expose a standard SMTP interface, which is good, however sending mail
speed is bottlenecked because every mail requires the body of the mail to
be uploaded.
In this case the body is standard html, not personalized.
Is it somehow possible to upload the template to the SMTP server, and
instead of traditionally formatting the body of the mail message and
uploading this everytime, rather just reference the uploaded html as the
body.
For example:
Current code:
using (System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient())
{
System.Net.Mail.MailMessage message = new
System.Net.Mail.MailMessage();
message.To.Add(item.Email);
message.Subject = subject;
message.From = new
System.Net.Mail.MailAddress(camp3.CampaignFromEmail);
message.Body = body;
message.IsBodyHtml = true;
smtp.Send(message);
}
The code I would like to write:
using (System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient())
{
string serverGUID = smtp.uploadHTMLTemplate(id);
System.Net.Mail.MailMessage message = new
System.Net.Mail.MailMessage();
message.To.Add(item.Email);
message.Subject = subject;
message.From = new
System.Net.Mail.MailAddress(camp3.CampaignFromEmail);
message.Body = "XTemplate: " + serverGUID;
message.IsBodyHtml = true;
smtp.Send(message);
}
Would such a thing be possible?

No comments:

Post a Comment