[SOLVED] mil() sending as unknown sender?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
pinehead18
Forum Contributor
Posts: 329
Joined: Thu Jul 31, 2003 9:20 pm

mil() sending as unknown sender?

Post by pinehead18 »

mail($email, "s.com - You have a new message", "You have a new mail message waiting for you in your
mail box. Click here to go to your inbox: http://www.", "FROM:
yoda@gmail.com");

When this arrives in $email's in box (anybody) it is from "unknown sender"

any ideas it is from an unknown sender rather than yoda@gmail.com?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

You may need Reply-To and Return-Path, there may be others.. Maybe naming your email address like "From: pinhead18 <yoda@gmail.com\r\n"..
pinehead18
Forum Contributor
Posts: 329
Joined: Thu Jul 31, 2003 9:20 pm

Post by pinehead18 »

That doesn't make much since to me, you don't know of any tutorials on it do ya?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

nothing more than the php.net man page for it: :arrow: mail
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

According to the manual, the from field has to be lowercase, and ended by \r\n. Take a look: [php_man]mail[/php_man]
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
pinehead18
Forum Contributor
Posts: 329
Joined: Thu Jul 31, 2003 9:20 pm

Post by pinehead18 »

well see the crappy thign is that did not fix it and the yoda@gmail.com appears at the top of the email but not in the from spot.

Any other ideaS?
zeroanarchy
Forum Newbie
Posts: 15
Joined: Wed Jul 21, 2004 8:51 pm

Post by zeroanarchy »

Hi pinehead18,

I have the exactly same problem and after reading around 20posts I have not come up with an answer. I keep getting the From line coming up as From: Nobody. the from line comes up in the message rather than where it should be in the From line.

I have tried

Code: Select all

mail ($to, $subject, $message, "$from\r\nX-Priority: 1 (Highest)")
            or Print "Counld not send mail";

Code: Select all

mail ($to, $subject, $message, $from) or Print "Counld not send mail";

Code: Select all

mail ("$recipient","$subject","$body", "From: Your Name<youremail@yourdomain.com>\r\nReply-To: youremail@yourdomain.com\r\n");
I am under the impression it is an error with a setting in the server, can anyone clarify this or perhaps offer a solution?

Cheers
zero
zeroanarchy
Forum Newbie
Posts: 15
Joined: Wed Jul 21, 2004 8:51 pm

Post by zeroanarchy »

ok just thought this might help anyone who comes up with the same problem here is what ended up working:

Cheers
zeroanarchy

Code: Select all

$to ="who@here.com";
$from = "$username <$emailfrom>";
$subject = "the subject";
$message = "$usermessage";
mail ("$to","$subject","$message","from:$from\n") or Print "Could not send mail";

?>
Post Reply