The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

moved server cannot send email using smtp in php app

Discussion in 'E-mail Discussions' started by jimlongo, Dec 3, 2013.

  1. jimlongo

    jimlongo Well-Known Member

    Joined:
    Mar 20, 2008
    Messages:
    145
    Likes Received:
    2
    Trophy Points:
    18
    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.

    Code:
    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.
    Code:
    define("PHPMAILERHOST",'');

    Any ideas what I can look at to enable sending via SMTP?

    Thanks.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
  3. jimlongo

    jimlongo Well-Known Member

    Joined:
    Mar 20, 2008
    Messages:
    145
    Likes Received:
    2
    Trophy Points:
    18
    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.

    Code:
    $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;
     
Loading...

Share This Page