Hello,

This is my first attempt at using MailMessage in ASP.NET to send an email.

I'm trying to process a form in my ASP.NET application so that the information gets emailed to my ISP email account. The problem is that my hosting company's SMTP does not allow "open relays", which seems to be the norm nowadays.

What other options do I have or is there a way around this? I've been working on this for a couple of days, and I didn't realize that I would run into these complications. At least I've had the opportunity to learn more about SMTP and open relays in general.

This is the code that I'm using...

VB Code:
  1. Dim msgMail As New MailMessage()
  2.  
  3.         msgMail.To = "[email protected]"
  4.         msgMail.From = "[email protected]"
  5.         msgMail.Subject = "Request for a Cost Estimate"
  6.  
  7.         msgMail.BodyFormat = MailFormat.Html
  8.         Dim strBody As String
  9.         strBody = "<html><body>" _
  10.                 & "<B>Company:</B> " & strCompany & "<BR>" _
  11.                 & "<B>Contact:</B> " & strContact & "<BR>" _
  12.                 & "<B>Phone:</B> " & strPhone & "<BR>" _
  13.                 & "<B>Email:</B> " & strEmail & "<BR>" _
  14.                 & "<B>Website:</B> " & strWebsite & "<BR>" _
  15.                 & "<B>Type of Solution:</B> " & strSolutionType & "<BR>" _
  16.                 & "<B>Solution Description:</B> " & strSolution & "<BR>" _
  17.                 & "<B>Date Required By:</B> " & strDate & "<BR>" _
  18.                 & "<B>Platforms:</B> " & strPlatforms & "<BR>" _
  19.                 & "<B>Users:</B> " & strNumberofUsers & "</body></html>"
  20.  
  21.         msgMail.Body = strBody
  22.         SmtpMail.SmtpServer =  "206.28.234.214"
  23.         SmtpMail.Send(msgMail)