I am working on desiging a contact form again and now the form must send out through a PHP script I know the standard code $sendTo, …, $mail … command works currently but a Webmail account such as Outlook cannot recieve it without the proper settings of the SMTP. I need help with this code
//New througput of SMTP (doesn't work)
require("class.phpmailer.php");
#######################################################################################################################
Variables
$TO = $_POST['to'];
$FROM = $_POST ['from'];
$EMAIL = $_POST ['email'];
$MESSAGE = $_POST ['message'];
$mail = new PHPMailer();
$mail = new PHPMailer();
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = "smtp.emailsrvr.com"; // SMTP server
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "[EMAIL="museum@historictecumseh.com"]museum@historictecumseh.com[/EMAIL]"; // SMTP username
$mail->Password = "$museum$"; // SMTP password
$mail->From = $EMAIL;
$mail->FromName = $FROM;
$mail->AddAddress($TO);
$mail->Subject = "Web Form Inquiry-- "
$mail->Body = "From:". $FROM ."
" . $MESSAGE;
$mail->WordWrap = 50;
if(!$mail->Send())
{
echo "Message was not sent";
echo "Mailer Error: " . $mail->ErrorInfo;
}
else
{
echo "Message has been sent";
}
Echo "<br>";
include ("backbutton.php");
The codes for the class shouldn’t be neccessary to show, it is PHPMailer - PHP email class code for the Mailer. The contact form includes a Name, email, and comments only. name, email, comments are the variables. I can see the message send through any standard client such as Yahoo and it will pick up through the junk mail so the code works as far as I know with the standard this code
//Original throughput of Flash
$sendTo = "[EMAIL="museum@historictecumseh.com"]museum@historictecumseh.com[/EMAIL]";
$subject = "Contact Form Message";
$headers = "From: " . $_POST["name"] ." ". "<" . $_POST["email"] .">
";
$headers .= "Reply-To: " . $_POST["email"] . "
";
$headers .= "Return-path: " . $_POST["email"];
$message = $_POST["comments"];
mail($sendTo, $subject, $message, $headers);
Nothing but your message has been sent will appear though either code, but the email does send through the second code not the first. It is on the second frame of the swf so it only appears when the data is retrieved from the php on the flash.
Any suggestions on an easier way to send it through the SMTP would be great because this code for the PHP mailer just as my mind going crazy.