<p>Using the obsolete System.Web.Mail sending email works fine, here's the code snippet:</p>

<pre><code> Public Shared Sub send(ByVal recipent As String, ByVal from As String, ByVal subject As String, ByVal body As String)
        Try
            Dim Message As System.Web.Mail.MailMessage = New System.Web.Mail.MailMessage
            Message.To = recipent
            Message.From = from
            Message.Subject = subject
            Message.Body = body
            Message.BodyFormat = MailFormat.Html
            Try
                SmtpMail.SmtpServer = MAIL_SERVER
                SmtpMail.Send(Message)
            Catch ehttp As System.Web.HttpException
                critical_error("Email sending failed, reason: " + ehttp.ToString)
            End Try
        Catch e As System.Exception
            critical_error(e, "send() in Util_Email")
        End Try
    End Sub
</code></pre>

<p>and here's the updated version:</p>

<pre><code>Dim mailMessage As New System.Net.Mail.MailMessage()

        mailMessage.From = New System.Net.Mail.MailAddress(from)
        mailMessage.To.Add(New System.Net.Mail.MailAddress(recipent))

        mailMessage.Subject = subject
        mailMessage.Body = body

        mailMessage.IsBodyHtml = True
        mailMessage.Priority = System.Net.Mail.MailPriority.Normal

        Try

            Dim smtp As New Net.Mail.SmtpClient(MAIL_SERVER)
            smtp.Send(mailMessage)

        Catch ex As Exception

            MsgBox(ex.ToString)

        End Try
</code></pre>

<p>I have tried many different variations and nothing seems to work, I have a feeling it may have to do with the SmtpClient, is there something that changed in the underlying code between these versions?</p>

<p>There are no exceptions that are thrown back.</p>

[{'answer_id': 52361, 'author': 'Kevin Fairchild', 'author_id': 3743, 'author_profile': 'https://Stackoverflow.com/users/3743', 'pm_score': 0, 'selected': False, 'text': '<p>Have you tried adding </p>\n\n<pre><code>smtp.UseDefaultCredentials = True \n</code></pre>\n\n<p>before the send?</p>\n\n<p>Also, what happens if you try changing:</p>\n\n<pre><code>mailMessage.From = New System.Net.Mail.MailAddress(from)\nmailMessage.To.Add(New System.Net.Mail.MailAddress(recipent))\n</code></pre>\n\n<p>to this:</p>\n\n<pre><code>mailMessage.From = New System.Net.Mail.MailAddress(from,recipent)\n</code></pre>\n\n<p>-- Kevin Fairchild</p>\n'}, {'answer_id': 52369, 'author': 'Robin Minto', 'author_id': 1456, 'author_profile': 'https://Stackoverflow.com/users/1456', 'pm_score': 1, 'selected': True, 'text': '<p>I\'ve tested your code and my mail is sent successfully. Assuming that you\'re using the same parameters for the old code, I would suggest that your mail server (MAIL_SERVER) is accepting the message and there\'s a delay in processing or it considers it spam and discards it.</p>\n<p>I would suggest sending a message using a third way (telnet if you\'re feeling brave) and see if that is successful.</p>\n<p>EDIT: I note (from your subsequent answer) that specifying the port has helped somewhat. You\'ve not said if you\'re using port 25 (SMTP) or port 587 (Submission) or something else. If you\'re not doing it already, using the sumission port may also help solve your problem.</p>\n<p><a href="http://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol" rel="nofollow noreferrer">Wikipedia</a> and <a href="https://www.rfc-editor.org/rfc/rfc4409" rel="nofollow noreferrer">rfc4409</a> have more details.</p>\n'}, {'answer_id': 52371, 'author': 'David Basarab', 'author_id': 2469, 'author_profile': 'https://Stackoverflow.com/users/2469', 'pm_score': 0, 'selected': False, 'text': '<p>Are you setting the credentials for the E-Mail?</p>\n\n<pre><code>smtp.Credentials = New Net.NetworkCredential("xyz@gmail.com", "password")\n</code></pre>\n\n<p>I had this error, however I believe it threw an exception.</p>\n'}, {'answer_id': 52374, 'author': 'pete blair', 'author_id': 5119, 'author_profile': 'https://Stackoverflow.com/users/5119', 'pm_score': 1, 'selected': False, 'text': '<p>The System.Net.Mail library uses the config files to store the settings so you may just need to add a section like this</p>\n\n<pre><code>  &lt;system.net&gt;\n    &lt;mailSettings&gt;\n      &lt;smtp from="test@foo.com"&gt;\n        &lt;network host="smtpserver1" port="25" userName="username" password="secret" defaultCredentials="true" /&gt;\n      &lt;/smtp&gt;\n    &lt;/mailSettings&gt;\n  &lt;/system.net&gt;\n</code></pre>\n'}, {'answer_id': 52407, 'author': 'Darren Kopp', 'author_id': 77, 'author_profile': 'https://Stackoverflow.com/users/77', 'pm_score': 0, 'selected': False, 'text': "<p>Everything you are doing is correct. Here's the things i would check.</p>\n\n<ol>\n<li>Double check that the SMTP service in IIS is running right.</li>\n<li>Make sure it's not getting flagged as spam.</li>\n</ol>\n\n<p>those are usually the biggest culprits whenever we have had issues w/ sending email.</p>\n\n<p>Also, just noticed you are doing MsgBox(ex.Message). I believe they blocked MessageBox from working asp.net in a service pack, so it might be erroring out, you just might not know it. check your event log.</p>\n"}, {'answer_id': 52435, 'author': 'DoryuX', 'author_id': 4827, 'author_profile': 'https://Stackoverflow.com/users/4827', 'pm_score': 0, 'selected': False, 'text': '<p>I added the port number for the mail server and it started working sporadically, it seems that it was a problem with the server and a delay in sending the messages.  Thanks for your answers, they were all helpful!</p>\n'}]
['https://Stackoverflow.com/questions/52321', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4827/']