moved server cannot send email using smtp in php app
I recently migrated servers.
I have a couple of installations of phpList that I use to send newsletters for various clients.
Before the move I was using a config that looks something like this and was working fine.
After the move when I try to send email it would fail to send the message. There are no php errors, or errors in any logs that I can find. As a workaround I changed the config to the following which forces the application to use PHP mail() to send and that works fine.
Any ideas what I can look at to enable sending via SMTP? Thanks.
define("PHPMAILERHOST",'vps.mydomain.com');
$phpmailer_smtpuser = 'news@mydomain.com';
$phpmailer_smtppassword = 'xxxxxxxxxx';
define('PHPMAILERPORT',465);After the move when I try to send email it would fail to send the message. There are no php errors, or errors in any logs that I can find. As a workaround I changed the config to the following which forces the application to use PHP mail() to send and that works fine.
define("PHPMAILERHOST",'');Any ideas what I can look at to enable sending via SMTP? Thanks.
-
Hello :) I recommend finding an alternate test PHP script for sending email via SMTP to rule out any issues with your specific script. Also, try changing the host to "localhost" instead of the hostname of your system. Thank you. 0 -
Thanks I tried a vanilla PHPMailer script and this configuration failed, UNLESS 'ssl' is capitalized. I will investigate my script further, but it worked before migration. $mail->Host = 'vps.mydomain.com'; $mail->SMTPAuth = true; $mail->Username = 'jimlongo@mydomain.com'; $mail->Password = 'xxxxxxxxxx'; $mail->SMTPSecure = 'SSL';
Also adding the port causes a fail with a message "SMTP NOTICE: EOF caught while checking if connected SMTP connect() failed." $mail->Port = 465;0
Please sign in to leave a comment.
Comments
2 comments