Forum Moderators: coopster
What I'd like to do:
Take that html code, which I send in an email, but instead of simply displaying it, attach it as a file...either as it's own seperate .html file or even a pdf or something. Does anyone know if this can be done?
Edit: My Goal is to send a printer friendly form (which is essentially html-based) via email.
Let me put it another way, have $message = the html code for a webpage.
$message is generated via values that are sent through the form. Currently, I can have $message appear in the email while keeping its html form. Is it possible to have $message attached as a .html file?
Note: Email with attachments and special types of content (e.g. HTML) can be sent using this function. This is accomplished via MIME-encoding - for more information, see this Zend article [zend.com] or the PEAR Mime Classes [pear.php.net].
Finally, notice that the second segment of the e-mail (the image) has an extra optional MIME header called Content-Disposition. This header is used to indicate to the e-mail client how it recommends the following segment be presented to the user. It can be set to either attachment (not part of the e-mail) or inline (included in the e-mail itself inline with the text).Content-Type: image/jpeg; name="zendlogo.jpg";
Content-Transfer-Encoding: base64Content-Disposition: attachment