Re: sending mail with pdf attachment

From: Date: Thu, 17 Apr 2003 14:50:01 +0000
Subject: Re: sending mail with pdf attachment
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-144294@lists.php.net to get a copy of this message
Normally you would have to write some sort of MIME message parser that would encode the attachment in to your message but PEAR (Yeah!) has made this wonderfully easy for us: http://pear.sourceforge.net/manual/core.mail.mime.php addAttachment() Adds an attachment to the email. It takes five arguments: a.. $file - Either a filename or the actual file data itself. b.. $c_type - Content type of the file. Defaults to application/octet-stream if not given. c.. $name - The filename of the file. Defaults to blank if not given. d.. $isfilename - Whether the $file argument is a filename or not. If true, the file will be read in Defaults to true if not given. e.. $encoding - Type of transfer encoding to use for the file data. Defaults to base64 if not given. for text based files (eg. scripts/html etc) this could be given as quoted-printable. Regards, Peter "Pod" Pistorius (Poor, unemployed, student in South Africa) peterp@podbox.co.za

« previous php.general (#144294) next »