Email server does not support secure connection [FIXED BY EXPERTS]

Milan Stanojevic
by Milan Stanojevic
Deputy Editor
0 Comments
Download PDF
Affiliate Disclosure

email server doesn't support secure connection

A large number of users have reported having an issue when trying to use their written script to send emails through Gmail.

They report that the issue arises suddenly after using the same script for a long time:

Ad

This issue can be extremely annoying, especially if you need the script to run properly for a company or multiple users. This error message is caused by one of the following issues:

  • the connection settings are incorrect (wrong port specified)
  • the credentials provided are incorrect (username and password)

For these reasons in this article, we will explore some of the best methods to solve this problem, and be able to send emails using your scrip again. Please follow the steps closely to avoid any unnecessary issues.

What to do if Email server doesn’t support secure connection?

1. Change ‘client.port’ value

coding pc - email server does not support secure connection

  1. If you find yourself in the same situation as the user mentioned above, you will simply need to stop using port 25, and change it to port 465 or 587.
  2. Using port 587 is a security requirement for outgoing mail (SMTP) server for Gmail.  
  3. This method should solve your issue, but if the issue persists, follow the next method.

Looking for a fast and reliable email client? Try one of these applications!



2. Change the value of SmtpServer.EnableSsl

code - email server doesn't support secure connection
The code of your script should look like this :

 Dim client As New Net.Mail.SmtpClient("smtp.gmail.com")
        client.Port = 587
        client.EnableSsl = True
        client.UseDefaultCredentials = False
        client.Credentials = loginInfo
        client.Send(mm)

Change the value of SmtpServer.EnableSsl from ‘true’ to ‘false’.

 SmtpServer.EnableSsl = true;

turns into:

SmtpServer.EnableSsl = false;

After changing this value, check to see if the issue persists. If it does, please follow the next method.


3. Change settings of your Gmail app

  1. In order to access the link provided in the next step, you will need to make sure you’re logged into your Gmail account
  2. Visit this link and activate the option ‘Access for less secure apps’.Less secure app access Gmail - email server doesn't support secure connection
  3. Retry running your script to check if the issue is resolved.

In this article, we explored some of the best methods to solve the issue caused by an error in the script for sending emails through Gmail.

Please feel free to let us know if this guide helped you solve your issue, by using the comment section below.

READ ALSO:

Ad
Was this page helpful?
Thanks for letting us know! You can also help us by leaving a review on MyWOT or Trustpillot.
Get the most from your tech with our daily tips
Tell us why!