by Jim
May 20, 2011 1:52 PM
The examples on Brinkster’s support pages are hit and miss, and they’re in VB.
static void SendMessage(string email, string messageBody)
{
var from = "you@yourdomain.com";
var credentials = new NetworkCredential(from, "password");
var message = new MailMessage()
{
From = new MailAddress(from),
Subject = "Subject",
Body = messageBody,
IsBodyHtml = true
};
message.To.Add(email);
var mailClient = new SmtpClient("mymail.brinkster.com", 2525)
{
DeliveryMethod = SmtpDeliveryMethod.Network,
UseDefaultCredentials = false,
Credentials = credentials
};
mailClient.Send(message);
}
Things to note:
- The from address must be the same email used to authenticate.
- Port 25 is the standard, but if this doesn’t work (it didn’t for me,) try port 2525.