Changing my FROM e-mail when using SendMail PHP

Changing my FROM e-mail when using SendMail PHP

Posted by: agroup
Posted on: 2006-05-09 22:09:00

I am new to Dreamhost and have a virtual account.

my from address that people are getting is currently "myusername@pringles.dreamhost.com". when I use the "Mail" function in PHP in my forms. (It doesn't matter what I set my Mail_From as because I am not on a windows server.)

I would like to customize this to my sites name/email address. I am on a virtual host so I do not have access (that i know of ) to httpd.conf which is what i figure i need to add the "-f" line everyone is talking about to.

The "-f" is the answer i recieved at other forums, on google, and from dreamhost support but none have told me the proper way to use it or where to put it as I am sure it is unique to every host, and unique to virtual and dedicated servers.

Could someone please explain the process to me.
What is the exact line I must add?
Where do I add this "-f" line ?
Do I have to use a special variation of the sendmail PHP function?

Thank you so much. Anyone...and everyone.

Re: Changing my FROM e-mail when using SendMail PHP

Posted by: silkrooster
Posted on: 2006-05-10 01:22:00

Using the mail command
it would be like this
$to='emailaddress@website.com';
$subject='subject';
$header='From: emailaddress@website.com';
$body='Your message'
mail ($to, $subject, $body, $header);

Silk

Re: Changing my FROM e-mail when using SendMail PH

Posted by: scjessey
Posted on: 2006-05-10 03:20:00

The DreamHost wiki has a good explanation of how the mail function works.

Re: Changing my FROM e-mail when using SendMail PH

Posted by: silkrooster
Posted on: 2006-05-10 17:04:00

Wow Jessey,
The wiki is getting more and more detailed.
Silk

Re: Changing my FROM e-mail when using SendMail PH

Posted by: scjessey
Posted on: 2006-05-10 18:57:00

In reply to:

Wow Jessey,
The wiki is getting more and more detailed.


It is my hope that the wiki will eventually become the first port of call for people looking for help, rather than this discussion forum.

Tags: email addressphp functionmail functiondreamhostaddgooglededicated servershttpd confvirtual hostrecievedwindows servervariation