ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.SMTP Email Error: Unable to connect to the remote server<blockquote><cite>rani says:</cite> <div class="line number8 index7 alt1"><code class="vb plain">smtp.Port = 25</code></div> <div class="line number9 index8 alt2"><code class="vb spaces">&nbsp;&nbsp;&nbsp;&nbsp;</code><code class="vb plain">smtp.EnableSsl = </code><code class="vb keyword">False</code></div> </blockquote> <p>Your Firewall is&nbsp;blocking port 25.</p> <p>Set the Port number to 587 or 465 and&nbsp;EnableSsl to True.</p> <pre class="brush: vb">Private Function SendEmail() As Boolean Dim mm As New MailMessage(&#34;test@gmail.com&#34;, &#34;test1@gmail.com&#34;) mm.Subject = &#34;Test&#34; mm.Body = &#34;test&#34; mm.IsBodyHtml = True Dim smtp As New SmtpClient() smtp.Host = &#34;smtp.gmail.com&#34; smtp.Port = 587 smtp.EnableSsl = True Dim NetworkCred As New NetworkCredential() NetworkCred.UserName = &#34;test@gmail.com&#34; NetworkCred.Password = &#34;test&#34; smtp.UseDefaultCredentials = True smtp.Credentials = NetworkCred Try smtp.Send(mm) Catch e As Exception Response.Write(e.Message) End Try Return True End Function</pre> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/147019/SMTP-Email-Error-Unable-to-connect-to-the-remote-server/https://www.aspforums.net:443/Threads/147019/SMTP-Email-Error-Unable-to-connect-to-the-remote-server/Thu, 25 Jul 2019 00:59:54 GMT