Problem with mail with PHP5

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
igotdamaged
Forum Newbie
Posts: 1
Joined: Fri Jun 17, 2005 5:27 am

Problem with mail with PHP5

Post by igotdamaged »

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

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" );
  }
?>
Post Reply