Alex Rivera | Logout

What's a quick, easy way to send HTML emails to myself to test them?

Asked 2009-01-20T11:01:49.207
28

I've been given the task of optimizing HTML emails for different email/webmail clients. I used to test the HTML file by doing a trick in Outlook Express, to make it send the raw HTML, but Microsoft seems to have stopped supplying Outlook Express now (I think "Live Mail" is supposed to replace it).

So my question is, is there a simple, quick way to send HTML emails? Maybe even a freeware program that does the job?

Edit
Report

1 Answer

1

If you are running .NET and you have a Gmail account this is one easy way

using System.Net;
using System.Net.Mail;

var fromAddress = new MailAddress("from@gmail.com", "From Name");
var toAddress = new MailAddress("to@example.com", "To Name");
const string fromPassword = "fromPassword";
const string subject = "Subject";
const string body = "Body";

var smtp = new SmtpClient
           {
               Host = "smtp.gmail.com",
               Port = 587,
               EnableSsl = true,
               DeliveryMethod = SmtpDeliveryMethod.Network,
               UseDefaultCredentials = false,
               Credentials = new NetworkCredential(fromAddress.Address, fromPassword)
           };
using (var message = new MailMessage(fromAddress, toAddress)
                     {
                         Subject = subject,
                         Body = body
                     })
{
    smtp.Send(message);
}

see Sending email in .NET through Gmail for more details

answered 2009-01-20T12:35:10.327

Your Answer