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.

Outgoing mails using server address instead of domain

Discussion in 'E-mail Discussions' started by syedasif11, Jul 1, 2011.

  1. syedasif11

    syedasif11 Registered

    Joined:
    Jul 1, 2011
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    I have a website on shared hosting. I have enabled SPF for my domain using CPanel. When I send emails from my domain using PHP script, the outgoing emails appear to be using my server's address (i.e. example@ln5.xyzdns.com) instead of my domain example.com. And therefore they are being marked as spam by Gmail and Hotmail as they are unable to verify the SPF record. Has anyone run into such a problem.

    Please suggest something.
     
  2. PIS

    PIS Member

    Joined:
    Jul 2, 2011
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    You must add headers for email, sending via PHP.
    like

    <?php

    $Name = "Da Duder"; //senders name
    $email = "sales@proiserv.com"; //senders e-mail adress
    $recipient = "support@proiserv.com"; //recipient
    $mail_body = "The text for the mail..."; //mail body
    $subject = "Subject text"; //subject
    $header = "From: www.proiserv.com"; //optional headerfields

    mail($recipient, $subject, $mail_body, $header); //mail command ?>

    or

    you also can set

    ini_set('sendmail_from', 'postmaster@proiserv.com');

    :)
     
Loading...

Share This Page