Prestashop SMTP Connection could not be established with host - smtp

I am having a problem configuring Prestashop SMTP.
I am trying to use gmail client.
SMTP server: smtp.gmail.com
Username: xxxxxxxx#gmail.com
Password: password_of_gmail
SSL
465
Error:
Connection could not be established with host smtp.gmail.com [Cannot assign requested address #99]
Gmail has turn off 2 step vertification, POP3 enabled, and Allow less secure apps enabled too.

Maybe your server doesn't allow external SMTP access.
For example 1and1 shared hosting doesn't allow that https://github.com/PHPMailer/PHPMailer/issues/816

Related

SMTP protocol + port numbers, IMAP, POP3

I need to provide a SMTP email service to a network and correctly configure the ports.
I understand SMTP uses port 25 over TCP, but have also read that SMTP is mainly used to transfer mail between mail servers and not the individual clients. Would either IMAP or POP3 be needed to send from the client to the server on port 993 or 995? or is there another port or way?
What other ports are needed to send an email via SMTP?
Thanks in advance

OpenCart emails not sending

My OpenCart website uses SendGrid as its email sending system. This all worked correctly up until recently. When using functions which require sending an email to the admin (eg. new order alert emails, creating a new account), I've been getting this error:
Notice: Error: Password not accepted from server! in .../system/library/mail.php on line 251
In OpenCart Settings > Mail, my settings are as follows:
Mail Protocol: SMTP
SMTP Host: smtp.sendgrid.net
SMTP Username: <username>
SMTP Password: <pass>
SMTP Port: 25
SMTP Timeout: 5
This is according to SendGrid's documentation: https://sendgrid.com/docs/Classroom/Basics/Email_Infrastructure/smtp_ports.html
Can anyone advise? These settings work on my localhost. I contacted the host to see if they blocked the SMTP port, but they replied that they don't have the ability to block the port since the SMTP host is not their website, but instead SendGrid.
This is not a port problem. I had the same issue: the SendGrid documentation is wrong. Documentation screenshot reports SendGrid username, but you have to use 'apikey'. I suggest to use port 587.

Integrating SendGrid

I'm trying to integrate SendGrid in the MVC application.
It is using the port 587. and SSL is enabled
Host = "smtp.sendgrid.net";
When I try to send an email, it is throwing :
System.Net.Sockets.SocketException : No connection could be made because the target machine actively refused it 159.122.224.196:587
Message : Failure sending mail.
Also when I ping smtp.sendgrid.net, it is using the IP 159.122.224.197
Do you have a firewall/antivirus application running on the machine that is blocking outgoing requests on port 587? If so, add a rule to allow outgoing requests on port 587.

CDO failed to connect on ports 465 and 587 but works on 25

We have a legacy FoxPro application that uses CDO for NTS to send STMP email through our Exchange server. We have 3 locations: Local (app run on same domain as Exchange server), VPN (app run on external network connected to domain via VPN), External (app run on external network and connects via Internet).
Up to now, Local has been configured to use port 25 with SSL. VPN and External have been configured to use port 465 with SSL. (My understanding from our network admin was that Exchange couldn't be configured to do SMTPS on 465 and we had to use STunnel).
Recently, we made changes to our Exchange server to disable SSL and only allow TLS. We opened up port 587. So according to my network admin, we now have Port 25 & 587 using the same Exchange Receive Connector and are set to use STARTTLS. Port 465 has also been configured to use STARTTLS and uses a different Exchange Receive Connector; however, the properties are all configured the same as the one used for 25 & 587.
After this change was made, our VPN and External sites were no longer able to send email through the application. The error message they get is:
OLE IDispatch exception code 0 from CDO.Message.1: The transport failed to connect to the server.
So, here is the current state of things:
Local - can send on 25 but not on 465 or 587
VPN - can not send on any of these ports
External - can not send on any of these ports
I also tried using the same code and was able to send SMTP from our system through gmail on port 465 and port 25 but not 587.
This is getting way beyond me at this point and I really don't know where to go from here. Does anyone have any ideas as to what may be going on?
I used WireShark to try to figure out what was being communicated between my client and the server (this would be for the Local scenario). Here are some the results:
Exchange on port 25 (Worked)
Exchange on port 465 (Fail)
Exchange on port 587 (Fail)
Gmail on port 465 (Worked)
Gmail on port 587 (Fail)
We finally found a workaround in case anyone is interested. Our Network Admin installed STunnel on our Exchange server and configured it to watch port 465. This got everything working again.

Exchange SQL Server 2008 Database Mail issue

In my web application I have created a mail sender class and set the configurations of web.config file like this:
<mailSettings>
<smtp deliveryMethod="PickupDirectoryFromIis">
<network host="smtp.domain.com"
port="587"
userName="mail#domain.com"
password="password"/>
</smtp>
</mailSettings>
This is sending email. But SQL Server database mail can not send mail with the same account info.
Only one difference is PickupDirectoryFromIis .
Is there any setting on exchange server?
In the SQL Server Logs the errors are following.
Message
The mail could not be sent to the recipients because of the mail
server failure. (Sending Mail using Account 2 (2012-09-30T16:55:04).
Exception Message: Cannot send mails to mail server. (The SMTP server
requires a secure connection or the client was not authenticated. The
server response was: 5.7.1 Client was not authenticated).
Looks like this is a Authentication issue or port no issue.
Authentication Issue:
—————————-
Please make sure you have put the information as explained below:
Server name: smtp.gmail.com ( this is really important)
port no: 587 ( on many website this is given as 465 which is wrong, use 587 )
Check : This server requires a secure connection
Check Basic Authentication
username: youremailid#gmail.com ( should have gmail.com)
password: XXXXXXXXXXXXX
confirm password: confirm your password
Port No Issue:
——————–
Make sure port 587 is opened in your machine if you are following above example. If you are using any other port number (usually its port 25) to set up database mail in your office, make sure you speak with your security team and ask them to unblock port 25. Once they unblock port 25, your databasemail will work.
Network Connectivity:
—————————–
Also check network connectivity from your machine, if you can connect to internet from your machine on which you are testing your database mail. To test, do the following
Start- Run- type cmd – Hit Enter
Type ping gmail.com -t and then hit enter.
If output displays as Request timed out, it actually means there is network connectivity problem. Otherwise, your network connectivity is good.