I am trying to send the mails from my PHP page. I am using the live.com SMTP server to send the mails from my live account. When I try to send the mail from PHP I am receiving the error
Error: SMTP Connect() failed.
What may be the problem?
Here is my mail configuration.
define("EMAIL_USE_SMTP", true);
define("EMAIL_SMTP_HOST", "smtp.live.com");
define("EMAIL_SMTP_AUTH", true);
define("EMAIL_SMTP_USERNAME", "XXXXXXXXXXXXX#live.com");
define("EMAIL_SMTP_PASSWORD", "XXXXXXXXX");
define("EMAIL_SMTP_PORT", 587);
define("EMAIL_SMTP_ENCRYPTION", "ssl");
I also tried changing the host to smtp.mail.live.com and port to 25, and 465 also but still not working.
Check that the machine firewall is allowing the port and connection
Try telnet from the machine with:
telnet smtp.live.com 587
Did you get:
220 BLU436-SMTP67.smtp.hotmail.com Microsoft ESMTP MAIL Service, Version: 8.0.92
00.16384 ready at Fri, 18 Sep 2015 01:06:29 -0700
If you get below, try open the machine firewall
Could not open connection to the host, on port XXX: Connect failed
Related
I'm facing below problem:
rcpt to: toxxxx#smtphost.com 454 4.7.1 toxxxx#smtphost.com
I'm facing below problem: telnet 10.5.2.28 25 Trying 11.1.2.21... Connected to 11.1.2.21. Escape character is... 220 smtp04.smtphost.com ESMTP Postfix HELO 171.21.1.21(application server) 250 smtp04.smtphost.com mail from: fromxxx#smtphost.com 250 2.1.0 Ok rcpt to: toxxxx#smtphost.com 454 4.7.1 <toxxxx#smtphost.com>: Relay access denied
: Relay access denied
The SMTP server that you are connecting to is not the MX for the recipient that you are trying to send the message to. So, to send the message, the SMTP server that you are connecting to would have to relay the message. The error that you are getting Relay access denied indicates that the SMTP server will not relay the message.
Did you authenticate with the SMTP server that you are connecting to? If not, then it's not surprising that you are seeing this error message, as otherwise this would be an open relay, and would probably quickly be abused by spammers.
We've been using PHPMailer to send SMTP mail through Mailgun for years now.
We've recently upgraded our logging, and we've noticed that some mail just doesn't send.
Here is the SMTP log we're seeing:
Connection: opening to smtp.mailgun.org:587, timeout=300, options=array()
Connection: opened
SERVER -> CLIENT: SMTP
NOTICE: EOF caught while checking if connected
Connection: closed
SMTP Error: Could not connect to SMTP host.
SMTP Error: Could not connect to SMTP host.
This particular email was attempted to be sent with the Start TLS method via port 587.
How come most of our mail gets through but now and then we get this error?
Does anyone know what "EOF caught while checking if connected" could be caused by?
We're using the latest stable build of PHPMailer v6.1.5.
Thanks!
Thanks to advice from #Syncro and #Álvaro González and Mailgun themselves, I ended up building in a retry mechanism that attempts to send mail 3 times before failing.
So far this seems to be working, I will report back if anything changes!
I have a Gsuite account. I setup a rule to allow SMTP relay through gmail servers, whitelisting my IP. Also, the FROM address is with my registered domain at Gsuite. And all my MX records point to google.
When trying to send a msg, the logs show that gmail accepts the connection, but in turn it passes is back to my local SMTP server.
Tried PHP PEAR mail & PHPMailer, same issue.
The logs start like this:
Connection: opening to smtp-relay.gmail.com:25, timeout=300, options=array ()
Connection: opened
SERVER -> CLIENT: 220-mylocalhosting.com ESMTP Exim 4.89 #1 Wed, 17 May 2017 23:44:41 -0400 220-We do not authorize the use of this system to transport unsolicited, 220 and/or bulk e-mail.
From there on, I can send emails if using authentication from my own system.
In short, I specify gmail relay server, but my messages end up going out from my local mail server. And I can't understand why.
UPDATE: If the PHP script runs as 'root', gmail takes the message and processes it as expected:
Connection: opening to smtp-relay.gmail.com:25, timeout=300, options=array ()
Connection: opened
SERVER -> CLIENT: 220 smtp-relay.gmail.com ESMTP 137sm1646549itk.4 - gsmtp
But I can't make it do the same as a regular user.
Any assistance would be appreciated.
Found the problem: It's a setting in WHM SMTP Restrictions. WHM Manual
I have a problem. I use phpmailer smtp gmail it works on localhost but when I upload that it is showing me these errors
SMTP ERROR: Failed to connect to server: Connection timed out (110)
SMTP connect() failed.
Mailer Error: SMTP connect() failed.
Any solution please. I am using phpmailer first time so I have no idea about it, thanks
The network that your server is running on may be blocking outgoing connections on the port that you are using to connect to smtp.gmail.com. You can test is this is happening, by using telnet to connect from the server to smtp.gmail.com on whichever port you are trying to connect on.
it looks as if your server is blocking access/connections to SMTP ports.
my wordpress site email goes to Spam with php function,some site offer me using wp-mail-smtp plugin will repair my problem, but it doesn't help me!
when I use php mail() function my emails goes to spam
and when i use SMTP, i have an error like this: SMTP -> ERROR: Failed to connect to server: Connection timed out (110)
i use this settings for smtp (in wp-mail-smtp plugin):
From Email: noreply#mydoamin.com
SMTP host: smtp.gmail.com
SMTP port: 465
Encryption: Use SSL encryption
Authentication: Yes: Use SMTP authentication
Username: myEmail#gmail.com
Password: mypassword
this settings give me an error!
note: i use captcha code and my server tell me port 465 is Open!
how can I send email in my wordpress site ?
A connection timed out means that the connection isn't going through. This could be your host, since I just checked your settings - they look OK!
I would look into contacting your host with this. For all I know, that's all you can do, unless you are going to use a 3rd party mail API.
A connection timeout means your host is dropping your outbound request to Gmail. You'll need to send your Gmail out on the HTTPS port using a WordPress plugin called Postman SMTP.