0
Colleagues.
I’m trying to send an email authenticated by Phpmailer using Gmail this way:
include("PHPMailer/class.phpmailer.php");
require('phpmailer/PHPMailerAutoload.php');
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPDebug = 1;
$mail->SMTPAuth = true;
$mail -> SMTPSecure = "ssl";
$mail->Host = "smtp.gmail.com";
$mail->Port = 587;
$mail->Username = '[email protected]';
$mail->Password = 'senhadoemail';
but you’re making that mistake:
2016-04-30 18:24:54 smtp error: failed to connect to server: (0) 2016-04-30 18:24:54 SMTP connect() failed.
Someone if the SMTP is the same?
Have some proxy or firewall on your network?
– Guilherme Nascimento
I am using my home network my computer has Microsoft’s own Windows Defender and is not using proxy...
– user24136
What happens is that the site is on a server ( cloud ) and the emails are on another server. I’m trying to send it through the cloud server, but we tried to put the server address ( email ), but it was an error too. When we do not authenticate, the messages arrive in any other email, but in the emails of this server do not arrive. That’s why I want to use Gmail email for this, but it also gives SMTP error.
– user24136
When I speak network I mean the network that the script ran, if the problem occurred in your server/ cloud is there in their firewall, you have to access the Cpanel (or equivalent and check if there are blocks), if you do not have access you will have to request with the support of the company
– Guilherme Nascimento
ah yes... I thought it was from here from home kkkkk ....entendi... I will take a look there....
– user24136
For you to authenticate with google SMTP, you need XOAUTH2 and no more user password. There is an alternative that is to authorize "less secure applications", but the best would be to make the application work on the new standard.
– Bacco