0

i'm Using livedoc to create a pdf. I've suceeded in doing so without saving the file to the server, and thats the objective here.

Can I attach the file I've created which is on a variable via phpmailer and email it.

require("php_mailer/phpmailer.inc.php");

$mail = new phpmailer;
$mail->From = "noreply@credireto.com";
$mail->FromName = "Crédireto";
$mail->Host = "smtp1.site.com;smtp2.site.com";  // specify main and backup server
$mail->AddAddress("$email");   // name is optional
$mail->WordWrap = 50;    // set word wrap
$mail->AddAttachment("$data","Simulação.pdf");  // add attachments
$mail->IsHTML(true);    // set email format to HTML
$mail->Subject = "Simulação Crédireto";
$mail->Body = filegetcontents("emailagradecimento");
$mail->Send(); // send message

The variable $data contains the file I want to send.

Maks3w
  • 6,014
  • 6
  • 37
  • 42
user2123665
  • 118
  • 7
  • Yah - encode it as BASE64 and attach the data via MIME. See here: http://stackoverflow.com/questions/9519588/send-php-html-mail-with-attachments – ethrbunny Mar 10 '13 at 16:05
  • That would be a solution if I weren't using phpmailer. Still I solved it. – user2123665 Mar 11 '13 at 16:01

1 Answers1

-2

I Solved It. Created a temp file and sent the attachment. Let me know if you need any help with this.

user2123665
  • 118
  • 7
  • 1
    Kind of defeats the purpose of SO if you don't just give the answer. Just tell us how you solved it, then we don't have to ask you. – Joshua Goossen Jul 09 '14 at 21:50