Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Jul 2011
    Posts
    1

    Default Outgoing mails using server address instead of domain

    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. #2
    PIS
    PIS is offline
    Member PIS's Avatar
    Join Date
    Jul 2011
    Posts
    21

    Default Re: Outgoing mails using server address instead of domain

    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');


Similar Threads & Tags
Similar threads

  1. How To Control Outgoing Spam Mails From The Server
    By jegavelan in forum E-mail Discussions
    Replies: 5
    Last Post: 01-19-2010, 07:13 AM
  2. Need list of all outgoing mails sent for a domain
    By ebizindia in forum E-mail Discussions
    Replies: 1
    Last Post: 11-09-2009, 03:25 AM
  3. Redirect outgoing mails ???
    By furquan in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 05-28-2007, 06:51 PM
  4. directing incoming and outgoing mails of a domain to a mailbox
    By lawrence.dcosta in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 02-26-2006, 10:45 AM
  5. addning disclaimer to all outgoing mails for a particular domain
    By kp_dude in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 12-02-2005, 05:58 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube