Re: Sending file stored on server via email - How?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Matt Arnilo S. Baluyos (Mailing Lists) kirjoitti:
What's the easiest way to go about this? Specifically, what's the
easiest way to read a file from the server and send it as an email
attachment.

I would suggest you to use http://phpmailer.sourceforge.net/ that is a featured class for sending e-mails from PHP scripts. It supports file attachments too. Messages can be sent over sendmail or direct SMTP with the PHPMailer.

(Untested) example:

require_once "class.phpmailer.php";
$mailer = new PHPMailer();
$mailer->AddAttachment("/tmp/myattachment.pdf","Attachment.pdf","base64","application/pdf");
$mailer->AddAddress("ville@xxxxxx");
$mailer->Subject = "PDF Attachment";
$mailer->Body = "This is a message with PDF attachment.";
$mailer->Send();


Ville

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux