Jump to content

PHPMailer Help


hoopplaya4

Recommended Posts

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       = "[email protected]"; //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("[email protected]", "John Doe");

$mail->AddAttachment("images/phpmailer.gif");             // attachment

if(!$mail->Send()) {
  echo "Mailer Error: " . $mail->ErrorInfo;
} else {
  echo "Message sent!";
}

?>

Link to comment
https://forums.phpfreaks.com/topic/109822-phpmailer-help/
Share on other sites

Hey Scott,

 

Thanks for the reply.  I'm sending this to myself, it's a gmail account.  And yes, I have checked the spam box as well.

 

I put the address in the "$mail->From      = "[email protected]" field.  (My email where the xxxx's are).

 

Is there somewhere else I'm supposed to enter the email address I'm sending to.  It's been a long day, so sorry if I'm overlooking something.

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/109822-phpmailer-help/#findComment-563620
Share on other sites

I never was impressed with phpmailer. When I was looking for a robust class for one of my projects <insert project plug>Mail Group Solution</plug>, I gave that one a go, and decided to stay away from that, and use MIME mailer from PHP Guru.  If you decide to give it a go, I can work up a example script for you.

Link to comment
https://forums.phpfreaks.com/topic/109822-phpmailer-help/#findComment-563917
Share on other sites

Hey jonsjava: I'd be willing to give MimeMail a shot-- I'm just looking for something that can send an attachment.

 

Essentially, what I'm trying to is have a user submit a form online, then have the form generated as a PDF with tcpdf, and then have a mailer send the email as an attachment.

 

Would MimeMail help me out with this, you think?

Link to comment
https://forums.phpfreaks.com/topic/109822-phpmailer-help/#findComment-563930
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.