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.

SOLVED PHP Mail Not Sending From Hosted Domain But Server Domain

Discussion in 'E-mail Discussions' started by Joef, Jul 27, 2017.

  1. Joef

    Joef Member

    Joined:
    Jan 15, 2017
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    usa
    cPanel Access Level:
    Root Administrator
    Hi,

    I running CENTOS 6.9 x86_64 kvm – server cPanel & WHM 64.0 (build 36) and have a dedicated IP for mydomian.com

    I have installed a script called PHPMailer I'm using to to allow visitors to send ecards to their friends. When I test it it goes through but goes to the spambox. Here is Mail Delivery Reports says:

    Event: success
    Sender User: user
    Sender Domain: mydomian.com
    Sender: user@server.myserver.com
    Sent Time: Jul 27, 2017 11:30:11 AM
    Sender Host: localhost
    Sender IP: 127.0.0.1
    Authentication: localuser
    Spam Score:
    Recipient: me@hotmail.com
    Delivered To: me@hotmail.com
    Delivery User: -remote-
    Delivery Domain:
    Router: lookuphost
    Transport: remote_smtp
    Out Time: Jul 27, 2017 11:31:11 AM
    ID: 1dakjy-0001lT-VY
    Delivery Host: mx2.hotmail.com
    Delivery IP: 65.55.33.135
    Size: 120.62 KB
    Result: Accepted

    The X-Mailer: PHPMailer 5.2.23 github.com/PHPMailer/PHPMailer

    *****************************************

    Then I have Wordpress installed and a newsletter module installed that sends a auto reply after someone subscribes. It doesn't get sent at all. Here is Mail Delivery Reports says for that:

    Event: failure
    Sender User: user
    Sender Domain: mydomian.com
    Sender: user@server.myserver.com
    Sent Time: Jul 27, 2017 9:40:09 AM
    Sender Host: localhost
    Sender IP: 127.0.0.1
    Authentication: localuser
    Spam Score:
    Recipient: me@hotmail.com
    Delivered To:
    Delivery User: -system-
    Delivery Domain:
    Router: lookuphost
    Transport: remote_smtp
    Out Time: Jul 27, 2017 9:40:09 AM
    ID: 1daj1R-0003yj-Hi
    Delivery Host: mx1.hotmail.com
    Delivery IP: 65.55.92.136
    Size: 1,001 bytes
    Result: ECDHE-RSA-AES256-SHA384:256 CV=yes: SMTP error from remote mail server after end of data: 550 5.7.0 (SNT004-MC1F47) Unfortunately, messages from (11.11.11.111) on behalf of (mydomian.com) could not be delivered due to domain owner policy restrictions.

    I'm not sure why this one doesn't get delivered but I think it's because I have dmarc set up.


    *****************************************

    I also have Magento ecommerce set up. It goes through prefect. Everything passes i.e. spf=pass, dkim=pass, dmarc=pass, Received-SPF: Pass. X-PHP-Originating-Script: 507:Sendmail.php

    So I'm very happy about that.

    ******************************************

    When I run a php test script from mydomian.com

    PHP:
    <?php
        ini_set
    'display_errors');
        
    error_reportingE_ALL );
        
    $from "admin@mydomain.com";
        
    $to "me@hotmail.com";
        
    $subject "PHP Mail Test script";
        
    $message "This is a test to check the PHP Mail functionality";
        
    $headers "From:" $from;
        
    mail($to,$subject,$message$headers);
        echo 
    "Test email sent";
    ?>
    It doesn't get delivered it's the same as the newsletter reply as above from Wordpress.

    I'm trying to get all the emails to go through like Magento. It seems I need toget mydomain.com to send the and not user@server.myserver.com?

    How can I fix this?

    Thank you
     
    #1 Joef, Jul 27, 2017
    Last edited: Jul 27, 2017
  2. Joef

    Joef Member

    Joined:
    Jan 15, 2017
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    usa
    cPanel Access Level:
    Root Administrator
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,288
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page