Hello.
I was happily using the following script and everything was cool.
Them my ISP upgraded to PHP 5 and now my script will not work.
Basically, the redirection part of the script is fine, but the bit which sends the emails out does not work.
Could somebody please take a look and tell me what needs to change.
Thank you very much...
<?
$theirname = $_REQUEST['theirname'] ;
$theiremail = $_REQUEST['theiremail'] ;
$yourname = $_REQUEST['yourname'] ;
$youremail = $_REQUEST['youremail'] ;
$message = $_REQUEST['message'] ;
if (!isset($_REQUEST['message'])) {
header( "Location: index.html" );
}
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("[email protected]", "Someone's told a friend",
"Dear $theirname,\n\n$yourname blah blah blah\n\nSent by: $yourname $youremail\nSent to: $theirname $theiremail",
"From: <!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e -->" );
header( "Location: index.html" );
}
?>I am experiencing similar issues with the mail() function - used to work in php4.x please any assistence greatly appreciated- What error message do you get?
- Are you using your mailer or an SMTP server?
- Have you ever thought to use an existing package such as PHP Mailer?
I was happily using the following script and everything was cool.
Them my ISP upgraded to PHP 5 and now my script will not work.
Basically, the redirection part of the script is fine, but the bit which sends the emails out does not work.
Could somebody please take a look and tell me what needs to change.
Thank you very much...
<?
$theirname = $_REQUEST['theirname'] ;
$theiremail = $_REQUEST['theiremail'] ;
$yourname = $_REQUEST['yourname'] ;
$youremail = $_REQUEST['youremail'] ;
$message = $_REQUEST['message'] ;
if (!isset($_REQUEST['message'])) {
header( "Location: index.html" );
}
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("[email protected]", "Someone's told a friend",
"Dear $theirname,\n\n$yourname blah blah blah\n\nSent by: $yourname $youremail\nSent to: $theirname $theiremail",
"From: <!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e -->" );
header( "Location: index.html" );
}
?>I am experiencing similar issues with the mail() function - used to work in php4.x please any assistence greatly appreciated- What error message do you get?
- Are you using your mailer or an SMTP server?
- Have you ever thought to use an existing package such as PHP Mailer?