...

View Full Version : email help?



lemmiwinksx
04-21-2003, 02:08 AM
hi, im new to php, and i want to write a simple email program:

<html>
<body>
<?
$to = "lemmiwinksx@lemmiwinksx.com";
$subject = "php is cool";
$body = "hello dylan";
$from = "cowsin@aol.com";
mail($to,$subject,$body,$from);
echo "mail was send to $to";
?>



</body>
</html>


it sends the mail, but it says from "webmaster@lemmiwinksx.com" instead of cowsin@aol.com
cowsin@aol.com comes as a link in the body, just above the mesage. is it supposed to do that?


thank you so much,
dylan

lemmiwinksx
04-21-2003, 02:13 AM
opps i forgot to include the From:
thanks for looking :):) :D :D

duniyadnd
04-21-2003, 03:54 AM
Might help:

http://www.codingforums.com/showthread.php?s=&threadid=18018

missing-score
04-21-2003, 09:29 AM
<?
$to = "lemmiwinksx@lemmiwinksx.com";
$subject = "php is cool";
$body = "hello dylan";
$from = "cowsin@aol.com\\n"; // The main problem is that you do not have a \\n here.

// Also:
if(mail($to,$subject,$body,$from))
{
echo "mail was send to $to";
}
else
{
echo "mail was not sent this time";
}
// By putting this in an if statement gives you a more accurate reading of what has happened.
?>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum