michelle
12-14-2006, 02:49 PM
I read the other posts about this topic, but still can't get the code below to work. I had a web form that used the php code below working on my site over the summer.
I wasn't getting forms sent into me the last couple months, so I figured no
one was submitting, then I tested it and turns out the php code no longer works. I ran it locally and it was fine.
I would love some help. Any idea what is going on?
<?php
require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = "mail.mySite.com";
$mail->SMTPAuth = true; //Turn on SMTP authentication
$mail->Username = "mySite.com"; //SMTP username
$mail->Password = "myPassword"; //SMTP password
$mail-> From = "emailaddress@mysite.com";
$mail->FromName = "The site";
$mail->AddAddress("responses@mysite.com", "The Site");
$mail->WordWrap = 50; //set word wrap
$mail->Subject = "Feedback from Site";
$mail->Body = '1 Place: ' .$_POST['1Place'] ."\n\n" .'2 Place: '.$_POST['2Place'] ."\n\n";
if(!$mail->Send())
{
echo "Message was not sent <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
?>
I wasn't getting forms sent into me the last couple months, so I figured no
one was submitting, then I tested it and turns out the php code no longer works. I ran it locally and it was fine.
I would love some help. Any idea what is going on?
<?php
require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = "mail.mySite.com";
$mail->SMTPAuth = true; //Turn on SMTP authentication
$mail->Username = "mySite.com"; //SMTP username
$mail->Password = "myPassword"; //SMTP password
$mail-> From = "emailaddress@mysite.com";
$mail->FromName = "The site";
$mail->AddAddress("responses@mysite.com", "The Site");
$mail->WordWrap = 50; //set word wrap
$mail->Subject = "Feedback from Site";
$mail->Body = '1 Place: ' .$_POST['1Place'] ."\n\n" .'2 Place: '.$_POST['2Place'] ."\n\n";
if(!$mail->Send())
{
echo "Message was not sent <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
?>