PHP Mail "from"

software development

#1

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:

myuserondreamhodt@seltzer.dreamhost.com

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


#2

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

–rlparker


#3

I try to add a line like this

$from = “Da: MySite admin@site.com”;
$from .= “\r\n”;

but nothing happens :-(((

other clue?


#4

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 name@domain.com”;

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.


#5

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


#6

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

si-blog
Max discount on any plan with promocode SCJESSEYTOTAL