View Single Post
  #11  
Old 09-03-2006, 01:41 AM
blnda84's Avatar
blnda84 blnda84 is offline
Sergeant First Class
 
Join Date: Jul 2006
Location: Tennessee
Posts: 57
Default Re: Tell A Friend Script

Hi Naval,

Here is my script:

<?php
require("class.phpmailer.php");
@$name = addslashes($_POST['name']);
@$friendname = addslashes($_POST['friendname']);
@$email = addslashes($_POST['email']);
@$subject = addslashes($_POST['subject']);
@$message = addslashes($_POST['message']);
@$youremail = addslashes($_POST['youremail']);

$mail = new PHPMailer();
$mail->IsSMTP(); // send via SMTP
$mail->Host = "localhost"; // SMTP servers
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "xxxxxxxx"; // SMTP username
$mail->Password = "jjjjjjjj"; // SMTP password
$mail->From = $youremail; // Your emailin your account
$mail->FromName = "Your Title";// The From name you want to appear in the email
$mail->AddAddress($email); //the receiver's email'
$mail->WordWrap = 50; // set word wrap
$mail->Subject = "$subject $name\n";
$mail->Body = "Hi $friendname\n"
. "$message\n "
. " \n"
. " Bye $name\n";
if(!$mail->Send())
{
echo "Message was not sent <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
header("Location: tell_a_friend.html"); // returnpage is the same page of the form or another of your choice.

?>


How do I add the script "Message not sent" ?
__________________
Belinda B.
BB Destination Express
Reply With Quote