Re: Sending file stored on server via email - How?
| From: | Ville Mattila | Date: | Mon, 08 Jan 2007 08:57:37 +0000 |
| Subject: | Re: Sending file stored on server via email - How? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-246738@lists.php.net to get a copy of this message | ||
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@pmd.fi"); $mailer->Subject = "PDF Attachment"; $mailer->Body = "This is a message with PDF attachment."; $mailer->Send(); Ville