Current time: 11-22-2024, 11:37 PM Hello There, Guest! (LoginRegister)


Post Reply 
[Solved] HowTo Change PHP mail sender name
Author Message
adigit Offline
Junior Member
*

Posts: 68
Joined: Apr 2007
Reputation: 0
Post: #1
[Solved] HowTo Change PHP mail sender name
when tried to send out TEST email with PHP mail and found the sender name is "virtual-user <webmaster@abc.com> "

and it's marked as "spam" by gmail! where can i change it, pls?
(This post was last modified: 07-19-2007 05:06 PM by adigit.)
07-16-2007 04:59 PM
Visit this user's website Find all posts by this user Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #2
RE: HowTo Change PHP mail sender name
have a look in the php.ini for the domain (abc.com in your example...)

/var/www/fcgid/<domain>/phpX/php.ini
07-16-2007 07:54 PM
Visit this user's website Find all posts by this user Quote this message in a reply
adigit Offline
Junior Member
*

Posts: 68
Joined: Apr 2007
Reputation: 0
Post: #3
RE: HowTo Change PHP mail sender name
i should state clearly that i want to change "virtual-user" to something like "webservice" or "info"
07-16-2007 10:10 PM
Visit this user's website Find all posts by this user Quote this message in a reply
raphael Offline
Member
***

Posts: 474
Joined: Apr 2007
Reputation: 8
Post: #4
RE: HowTo Change PHP mail sender name
that can be done passing the $headers arg to mail() and adding the 'From: somebody <mail@mydomain.tld>' header.
07-17-2007 02:06 AM
Visit this user's website Find all posts by this user Quote this message in a reply
adigit Offline
Junior Member
*

Posts: 68
Joined: Apr 2007
Reputation: 0
Post: #5
RE: HowTo Change PHP mail sender name
i change the sendmail_path with -F 'From: somebody <mail@mydomain.tld>', it works for gmail. but for some other emails, it shows the email sender as vu200x@mydomain.tld.local instead.
07-17-2007 05:37 PM
Visit this user's website Find all posts by this user Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #6
RE: HowTo Change PHP mail sender name
Ok, there are two sort of sender in an e-mail:
the envelope sender - which is set in the php.ini and
the "from" sender which you can set while sending an email - as raphael stated above: adding some more headers to the "mail()" function in the php-script.

Normally the "from" sender is the one which is important - sometimes the envelope sender two - but mostly it's ok if the envelope sender is a valid mail address...

Cheers
J.
(This post was last modified: 07-17-2007 09:42 PM by joximu.)
07-17-2007 09:42 PM
Visit this user's website Find all posts by this user Quote this message in a reply
adigit Offline
Junior Member
*

Posts: 68
Joined: Apr 2007
Reputation: 0
Post: #7
RE: HowTo Change PHP mail sender name
thanks joximu, very clear explanation!
07-19-2007 05:05 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)