Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP Sendmail--remove From: Root User <me@website.com> from header

Status
Not open for further replies.

iteach2

Technical User
Sep 16, 2001
120
US
Hi,

Im using PHP sendmail on an Apache/Windows server. Whenever an email is sent out - the From: header says Root User. For exp.


From:Root User <peoples@myswebsite.com>

How do I make it say something other than Root User.

From what I can tell, and I might be wrong, There is nowhere in the php.ini file that lets you change this setting.

 
What are you using to send the email? If using [blue[mail()[/blue], add the header variable to define the from value:

Code:
$headers = "From: ".$fromname."<".$fromaddress.">"

mail($to,$subject,$message,[red]$headers[/red]);

[/quote]

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Hi, Thanks for your reply. I am actually using phpmailer. Is there a way to do this with phpmailer- that u know of.
 
I would think this should do it:

Code:
$mail->From = "from@example.com";

While you are creating the email.

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
This is what I have.

Code:
$mail->IsSMTP();
$mail->Host = "mail.com.com";
$mail->From = "work@brill.com";

Could it be some setting on the mail server that we use to process/authenticate email transmissions.
 
Does the mail server allow unauthenticated relay from your IP address?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top