Forum Moderators: coopster

Message Too Old, No Replies

From section in email displays my serverhost

         

dazzclub

10:13 am on Apr 9, 2008 (gmt 0)

10+ Year Member



Hi there,

I am creating a simple email script but i have run into a problem.

When i submit the email and then check my account to see if its appeared. After I click on it the "from" that should normaly display, say my email or some text, displays a sentence informing me that my host has sent it on my behalf, showing my email next to it.

i have attached a link to an image, this should describe my problem alot better

here is my php script
---------------------
//send email aswell
$to = "me[at]example.com";
$subject = "Your Free sample order";
$content = "sample:\n
Thank you for your interest in our productTEST. Your sample will be despatched shortly";
$header = "From: me[at]example.com\n";
$header .= "Reply-To: me2[at]example.co.uk\n";

//spacer
mail($to, $subject, $content, $header);
}
---------------------
kind regards
Dazzclub

[edited by: jatar_k at 12:50 pm (utc) on April 9, 2008]
[edit reason] no urls thanks [/edit]

jatar_k

12:51 pm on Apr 9, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



>> i have attached a link to an image, this should describe my problem alot better

actually the title of the thread explained it perfectly

my first thought is to have Return-Path, Reply-To and From all present and set to the same email address

the other thing you could do is look at settings in php.ini but most hosts don't change this on shared hosting

reference
[php.net...]

NameNick

9:12 pm on Apr 10, 2008 (gmt 0)

10+ Year Member



Adding a Sender: header helps sometimes.

NN

dazzclub

10:28 pm on Apr 10, 2008 (gmt 0)

10+ Year Member



do you mean $sender = "myemailacount"?

There is a sender in its in the header,
$header = "from: me[at]example.com\n";

or am i totally wrong

sneaks

10:35 pm on Apr 10, 2008 (gmt 0)

10+ Year Member



i am pretty sure you can just use the ini_set() function:

ini_set(sendmail_from,$fromaddress)

otherwise you need to go into your php.ini

NameNick

10:57 pm on Apr 10, 2008 (gmt 0)

10+ Year Member



I meant

$header = "Sender: me[at]example.com\n";

NN

barns101

12:00 pm on Apr 11, 2008 (gmt 0)

10+ Year Member



On some server setups you need to use the 5th mail() parameter and add -f[your email address]:

mail('x', 'x', 'x', 'x', '-fme@example.com');