Outgoing mails using server address instead of domain

syedasif11

Registered
Jul 1, 2011
1
0
51
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. [email protected]) 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.
 

PIS

Member
Jul 2, 2011
21
0
51
You must add headers for email, sending via PHP.
like

<?php

$Name = "Da Duder"; //senders name
$email = "[email protected]"; //senders e-mail adress
$recipient = "[email protected]"; //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', '[email protected]');

:)