PHPMailer supports transfer

I successfully configured the web application using WAMPSERVER on a desktop used by several people from within, this used PHPMailer for the internal SMTP server without encryption or authentication, and it worked.

This desktop crashed, and I switched to the "new" desktop. I had SVN setup, so I even used most files and configuration. One of the differences that can make a difference is that the old desktop was 64-bit and the new 32-bit. This means that I am using different versions of WAMPSERVER.

The sender just freezes. I am not getting a PHP error or a PHP timeout. I just didn't get to the end of my script. The crazy part about this is that it works with authentication, ssl and gmail. It simply won’t work with the extra simple case that I need.

It works:

<?php require('class.phpmailer.php'); $mail=new PHPMailer(); $mail->ISSMTP(); $mail->Host='smtp.gmail.com'; $mail->Subject='test subj'; $mail->Body='the body email test'; $mail->SMTPDebug = 1; // enables SMTP debug information (for testing) $mail->SMTPAuth = true; // enable SMTP authentication $mail->SMTPSecure = "ssl"; // sets the prefix to the servier $mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server $mail->Port = 465; // set the SMTP port for the GMAIL server $mail->Username = " myemail@gmail.com "; // GMAIL username $mail->Password = "mypassword"; // GMAIL password $mail->AddAddress(' toemail@supersecret.com ', 'John Doe'); $mail->SetFrom(' something@gmail.com ', 'First Last'); $mail->Send(); ?> 

to which it applied, but now no:

 <?php require('class.phpmailer.php'); $mail=new PHPMailer(); $mail->ISSMTP(); $mail->Host='smtp.internal.com'; $mail->Subject='test subj'; $mail->Body='the body email test'; $mail->SMTPDebug = 1; // enables SMTP debug information (for testing) $mail->Port = 25; // set the SMTP port for the GMAIL server $mail->AddAddress(' myaddress@somewhere.com ', 'John Doe'); $mail->SetFrom(' someaddress@mightbereal.com ', 'First Last'); $mail->Send(); ?> 

The only thing I get from debugging is

CLIENT β†’ SMTP: EHLO thedesktophostname

The page does not display errors and nothing in the apache log, where I usually get PHP errors if they do not appear.

I can install telnet on the host from the desktop on port 25 and even enter the EHLO command and get a good response from the server.

I do not remember this problem before, although perhaps I have already solved it once. I could not find anything that would help here or on Google.

Please, help. Thanks.

+6
source share
4 answers

Unfortunately, this probably will never help anyone else who has the same problem, but I was able to get everything just by changing the port to 465.

+2
source

Having dismissed the message to say that I had the same problem, but set the port to 465 without setting SMTPSecure to 'ssl' in the example set by its TLS by default.

+13
source

In the end, a solution was found for my configuration.
Just add ssl: // to smtp.google.com
$mail->Host = 'ssl://smtp.gmail.com';

0
source

I had the same problem. Nothing is displayed after the submit method. I realized that the encryption was wrong, I used SMTPS

 $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; // Enable TLS encryption, 'PHPMailer::ENCRYPTION_SMTPS' also accepted 
0
source

All Articles