Jump to content

hoopplaya4

Members
  • Posts

    161
  • Joined

  • Last visited

    Never

Everything posted by hoopplaya4

  1. OK: I figured out the date code, but more specifically, how would I include the ".pdf" portion. I'm not sure if my syntax is correct. Here's what I have: $filename = date("H.i.s"); $pdf->Output($filename, "F"); $mail = new PHPMailer(); $mail->MsgHTML($body); $mail->AddAddress("myemail@gmail.com", "My Name"); if(!$mail->AddAttachment($filename)) { echo "There was a problem attaching the pdf."; echo $mailer->ErrorInfo; } if(!$mail->Send()) { echo 'Failed to send mail'; } else { echo 'Mail sent!'; } Where would I add the .pdf? And how? Thanks!!
  2. Thanks for the quick reply. Could you explain or provide a link on how to use the date function? Even a small example would help.
  3. Hey All, I'm using tcPDF to take the values of a form, create a PDF, (test.pdf) and then store it on the server. Right now I have it set up to overwrite the same PDF everytime, What can I add into my code to make it create a new file everytime, for example: test0001.pdf, test0002.pdf, test0003.pdf, etc.? Here's a snippet of code I'm using: $filename = "test.pdf"; $pdf->Output($filename, "F"); $mail = new PHPMailer(); $mail->MsgHTML($body); $mail->AddAddress("myemail@gmail.com", "My Name"); if(!$mail->AddAttachment($filename)) { echo "There was a problem attaching the pdf."; echo $mailer->ErrorInfo; } if(!$mail->Send()) { echo 'Failed to send mail'; } else { echo 'Mail sent!'; }
  4. Thank you! Worked great! I'm terrible with paths.
  5. Hey all: I need some help with my path in my PHP. I keep getting the error: At the beginning of the php doc I'm putting in: require('/tcpdf/phpmailer/class.phpmailer.php'); require_once('/tcpdf/config/lang/eng.php'); require_once('/tcpdf/tcpdf.php'); This PHP document is located in: www.website.com/dev/ And I am try to have the require functions point to: www.website.com/dev/tcpdf/phpmailer/class.phpmailer.php www.website.com/dev/tcpdf/config/lang/eng.php www.website.com/dev/tcpdf/tcpdf.php What am I doing wrong? Thanks!
  6. 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?
  7. Ok. Thanks. If anyone else knows anything about using PHPMailer, that'd be great. Thanks.
  8. None that I can see on the front end. All I see is "Message Sent!" Not sure where to look for errors on the server-side with GoDaddy.
  9. Anyone else have any ideas? ???
  10. 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.
  11. 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!"; } ?>
×
×
  • 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.