Jim Rogers

Lives in Baton Rouge, LA, with two dogs, one cat, and one lovely wife. I'm a lead developer for GCR Incorporated.

Katrin and Jim

Month List

Sending email from a brinkster account in C#

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.

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading