title: My asp.NET server on DiscountAsp.net won't send emails
body: <p>So I have an asp.net server running on discountasp.net and for whatever reason when I just published the new version of the website it stopped sending emails.  I tried changing the code back to exactly how it was done in the old website and it didn't work.  I've tried many other solutions to no avail.  Here's the old code:</p>
  
  <pre><code> Dim message As New MailMessage
          message.IsBodyHtml = True
          message.From = New MailAddress("example@mydomain.com", "inquiry@mydomain.com")
          If Me.ddlSendTo.SelectedValue = 1 Then
              message.To.Add(New MailAddress("sales@mydomain.com"))
              message.Subject = "Sales Inquiry From mydomain.com"
          ElseIf Me.ddlSendTo.SelectedValue = 2 Then
              message.To.Add(New MailAddress("support@mydomain.com"))
              message.Subject = "Support Question From mydomain.com"
          End If
  
          Dim sb As New StringBuilder()
          sb.Append("The following message was sent from a user of our website as a request for more information.&lt;br/&gt;&lt;br/&gt;")
          sb.Append("Here is the message they sent:&lt;br/&gt;&lt;br/&gt;")
          sb.Append("Sender's Name: " &amp; Me.txtSenderName.Text &amp; "&lt;br/&gt;")
          sb.Append("Senders Email: &lt;a href='mailto:" &amp; Me.txtSenderEmail.Text &amp; "'&gt;" &amp; Me.txtSenderEmail.Text &amp; "&lt;/a&gt;&lt;br/&gt;")
          sb.Append("Company Name: " &amp; Me.txtCompany.Text &amp; "&lt;br/&gt;")
          sb.Append("Phone Number: " &amp; Me.txtPhone.Text &amp; "&lt;br/&gt;&lt;br/&gt;")
          sb.Append("Subject: " &amp; Me.txtSubject.Text &amp; "&lt;br/&gt;")
          sb.Append("Message: " &amp; Me.txtEmailMsg.Text)
          message.Body = sb.ToString()
  
          Try
              Dim client As New SmtpClient()
              client.Host = "localhost"
              client.Send(message)
          Catch ex As SmtpException
              Me.errors.InnerHtml = ex.Message &amp; " local host message"
              Return
          End Try
  </code></pre>
  
  <p>Here's my current iteration that is still not working:</p>
  
  <pre><code>Dim toEmail As String
      Dim subject As String
      If Me.ddlSendTo.SelectedValue = 1 Then
          If isTesting() Then
              toEmail = GetTesterEmail()
          Else
              toEmail = "sales@mydomain.com"
          End If
  
          subject = "Sales Inquiry From MyDomain.com"
      ElseIf Me.ddlSendTo.SelectedValue = 2 Then
          If isTesting() Then
              toEmail = GetTesterEmail()
          Else
              toEmail = "support@mydomain.com"
          End If
          subject = "Support Question From MyDomain.com"
      End If
  
      Dim sb As New StringBuilder()
      sb.Append("The following message was sent from a user of our website as a request for more information.&lt;br/&gt;&lt;br/&gt;")
      sb.Append("Here Is the message they sent:&lt;br/&gt;&lt;br/&gt;")
      sb.Append("Sender's Name: " &amp; Me.txtName.Value &amp; "&lt;br/&gt;")
      sb.Append("Senders Email: &lt;a href='mailto:" &amp; Me.txtEmail.Value &amp; "'&gt;" &amp; Me.txtEmail.Value &amp; "&lt;/a&gt;&lt;br/&gt;")
      sb.Append("Company Name: " &amp; Me.txtCompany.Value &amp; "&lt;br/&gt;")
      sb.Append("Phone Number: " &amp; Me.txtPhone.Value &amp; "&lt;br/&gt;&lt;br/&gt;")
      sb.Append("Subject: " &amp; Me.txtSubject.Value &amp; "&lt;br/&gt;")
      sb.Append("Message: " &amp; Me.txtMessage.Value)
      'message.Body = sb.ToString()
      Dim message As New MailMessage("postmaster@mydomain.com", toEmail, subject, sb.ToString())
      message.IsBodyHtml = True
      Try
          Dim client As New SmtpClient()
          client.Host = "smtp.mydomain.com"
          client.Port = 25
          client.Credentials = New System.Net.NetworkCredential("postmaster@mydomain.com", "password")
          client.Send(message)
      Catch ex As SmtpException
          Me.errors.Text = ex.Message &amp; " local host message"
          Return
      End Try
  </code></pre>
  
  <p>I tried leaving off network credentials, leaving off port, leaving off the @mydomain.com on the network credentials.  Nothing works</p>