PHP Mail "from"

Hi to all, this is my 1st post in this board. I’ve a little problem. I need to send an email from a little script, when some thing happens…

The email, work correctly, but when I read that, in the fild “from” there is:

But absolutely I don’t want that! I want to read my domain name, and not the server where i’m hosted… any idea to fix that directly in php?

Thx in advance for the collaboration

There is information in this previous forum post that might be of help to you. :wink:


I try to add a line like this

$from = “Da: MySite”;
$from .= “\r\n”;

but nothing happens :-(((

other clue?

As I understand things the “from” is stored in a header using the tag “From:” - despite the use of language. The mail client I believe will display “From:” or “Da:”

You need to put it in the mail headers:

$mailheaders = “From: My website”;

Don’t forget to pass the $mailheaders variable when creating the actual mail. Just putting a value in a string doesn’t do anything with it.

Wholly - Use promo code WhollyMindless for discount.

yes got it… I’m italian, and I try to change Da in from, now it works very well…

Thx for the collaboration! to Wholly and rlparker

There is a DreamHost Wiki article about PHP’s mail() function that explains how to use headers, etc., by the way.

Max discount on any plan with promocode SCJESSEYTOTAL