Problem with mail with PHP5
Posted: Fri Jun 17, 2005 5:32 am
Hi,
I was using a PHP mailing script happily, until the other week when my ISP updated to PHP 5.
Now my script performs the redirection part of the script ok, but will not send the emails out.
Could someone please take a look at my code and tell me what needs to be changed?
Thank you
I was using a PHP mailing script happily, until the other week when my ISP updated to PHP 5.
Now my script performs the redirection part of the script ok, but will not send the emails out.
Could someone please take a look at my code and tell me what needs to be changed?
Thank you
Code: Select all
<?
$theirname = $_REQUEST['theirname'] ;
$theiremail = $_REQUEST['theiremail'] ;
$yourname = $_REQUEST['yourname'] ;
$youremail = $_REQUEST['youremail'] ;
$message = $_REQUEST['message'] ;
if (!isset($_REQUEST['message'])) {
header( "Location: http://www.whatever.com" );
}
elseif (empty($youremail) || empty($theiremail)) {
header( "Location: error.html" );
}
else {
mail( "$theiremail", "Message from $yourname",
"Dear $theirname,\n\n$yourname blah blah blah\n\n$message\n\nLots of love,\n\whatever.com",
"From: $yourname <$youremail>" );
mail("hello@whatever.com", "Someone's told a friend",
"Dear $theirname,\n\n$yourname blah blah blah\n\nwhatever.com\n\nSent by: $yourname $youremail\nSent to: $theirname $theiremail",
"From: hello@whatever.com" );
header( "Location: http://www.whatever.com" );
}
?>