Dummy Mail() headers
Moderator: General Moderators
Dummy Mail() headers
Im using the PHP mail() fn to send txt msgs. A txt msg is nothing more than an email to a cell phone. No big deal. Problem is, when the cell phone recieves the msg, the actual server address is used as the reply address. Its the first thing displayed on the cell phone. I tried changing all of the headers by including them in the mail() line, but it still doesnt work.
How do I get it to say whatever return address i like?
Do i have to change something in php.ini or does my hosting provider have to turn something on.off??
thanks
How do I get it to say whatever return address i like?
Do i have to change something in php.ini or does my hosting provider have to turn something on.off??
thanks
- evilmonkey
- Forum Regular
- Posts: 823
- Joined: Sun Oct 06, 2002 1:24 pm
- Location: Toronto, Canada
I'm not exactly sure what you meant by "tried changing the headers", but try this code:
Might just waork. Taken straight from the PHP manual. http://ca2.php.net/manual/en/function.mail.php
Good luck!
Code: Select all
<?php
mail ("yourcellphone@someaddr.com", "My Subject", "This is just a test message",
"FROM EvilMonkey\r\n".
"REPLY-TO: evilmonkey@{$_SERVER[SERVER_NAME]}");
?>Good luck!
Sorry, thats what i ment. Changing Reply-To: as you did will work when in the email, but i need to change the return-path. Im sending txt msgs. it doesnt display the from or reply to addreess, but the return path for some odd reason. What is to be displayed is set in php.ini, but my host doesnt seem to want to help (godaddy). I tried overwriting the send_from setting in the .ini wih ini_set() and even creating an .htaccess file, but neither work.
I cant figure out why. Any ideas?
I cant figure out why. Any ideas?
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Last I saw, the case and syntax of the headers was extremely important:
Code: Select all
mail(
"to_whoever@some_domain.com",
"subject line",
"message",
"From: from_me@mydomain.com\r\n".
"Reply-To: from_someone@elses_domain.com\r\n". // it may be Reply-to, but all the email I quickly checked was 'T'
"Return-Path: yet_another@address.com\r\n" // again, could be Return-path, I couldn't find an example in my email though..
);-
hypercooljake
- Forum Newbie
- Posts: 6
- Joined: Sat Nov 01, 2003 12:48 pm
- Location: Appleton, Wi
- Contact:
It is Reply-To: and Return-Path:, not to or path.feyd wrote:Last I saw, the case and syntax of the headers was extremely important:Code: Select all
mail( "to_whoever@some_domain.com", "subject line", "message", "From: from_me@mydomain.com\r\n". "Reply-To: from_someone@elses_domain.com\r\n". // it may be Reply-to, but all the email I quickly checked was 'T' "Return-Path: yet_another@address.com\r\n" // again, could be Return-path, I couldn't find an example in my email though.. );
- launchcode
- Forum Contributor
- Posts: 401
- Joined: Tue May 11, 2004 7:32 pm
- Location: UK
- Contact:
- launchcode
- Forum Contributor
- Posts: 401
- Joined: Tue May 11, 2004 7:32 pm
- Location: UK
- Contact:
- launchcode
- Forum Contributor
- Posts: 401
- Joined: Tue May 11, 2004 7:32 pm
- Location: UK
- Contact: