I have a typical "cannont send an email using php' problem.
I have a bunch of fileds in flash, and they are posting to an external php page which is not sending the mail. thI originally tried using sendmail, however the host won't allow sendmail. I then used their suggested script and of course it doesn't work.
I'm using loadVariableNum in actionscript which works fine since I can add variables from this particular server to a database, but there is something wrong with the script they provided.
Can somebody please check out this code and point me in the right direction?
Code: Select all
<?PHP
$yourname = $_POST['yourname'];
$friendsname = $_POST['friendsname'];
$email = $_POST['email'];
$friendsemail = $_POST['friendsemail'];
$themessage = $_POST['message'];
include('Mail.php');
$recipients = '"friendsemail" <$friendsemail>';
$headers['From'] = '"yourname" <$email>';
$headers['To'] = '"friendsemail" <$friendsemail>';
$headers['Cc'] = '';
$headers['Bcc'] = '';
$headers['Subject'] = 'test php message subject';
$body = '$themessage';
$params['host'] = 'scriptmail.intermedia.net';
$mail_object =& Mail::factory('smtp', $params);
if ( $mail_object->send($recipients, $headers, $body) ) {
echo "Mail was successfully sent";
}
else {
echo "Cannot send mail!";
}
?>thanks a million.