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       = "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!";
}

?>

Link to comment
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      = "xxxx@xxxx.com" 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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.