Hey all,
I've spent several hours googling and browsing through forums, but cannot find any concrete help.
I'm new to PHP, and loving what I'm learning so far. I've run into a little bit of trouble with trying to get PHPMailer installed and getting it to work.
Unfortunately (against my will), the site I'm working on is on a shared server on GoDaddy. I've heard several great things about PHPMailer, and how awesome it is, however, I cannot get the test_mail.php to work. When I browse to the page, I see "Message Sent!" but I see nothing in the my inbox. I hope I'm not overlooking anything, but any help would be great!
Am I doing something wrong? Is there something wrong with my code?
I'm testing the default "test" file that comes with PHPMailer, (of course I'm entering in my email address).
test_mail.php:
<?php
include_once('../class.phpmailer.php');
$mail = new PHPMailer(); // defaults to using php "mail()"
$body = $mail->getFile('contents.html');
$body = eregi_replace("[\]",'',$body);
$mail->From = "xxxx@xxxx.com"; //this is where I'm entering my email address of where I want it sent to-- is this correct?[/color]
$mail->FromName = "Kyle";
$mail->Subject = "PHPMailer Test Subject via mail()";
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
$mail->MsgHTML($body);
$mail->AddAddress("whoto@otherdomain.com", "John Doe");
$mail->AddAttachment("images/phpmailer.gif"); // attachment
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent!";
}
?>