faqts : Computers : Programming : Languages : PHP : Common Problems : Email

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

40 of 82 people (49%) answered Yes
Recently 3 of 10 people (30%) answered Yes

Entry

How do you send an email attachment using php3?
I want to send an email with an attachment to a MAC but it is unable to read the MIME encoded messag

Mar 13th, 2000 18:18
Kris Erickson, daryl lamble, unknown unknown, Joanne Whiteman,


You can use the mail() function, however you leave the body empty 
and put all the content into the headers.

e.g.

mail("dave@example.com","info about mailing","",$header_contents);

where $header_contents is a properly mime encoded message (for
full details see the following rfcs)...

http://www.faqs.org/rfcs/rfc822.html
http://www.faqs.org/rfcs/rfc2045.html
http://www.faqs.org/rfcs/rfc2046.html
http://www.faqs.org/rfcs/rfc2048.html
... and about 10 others...

However there is a nice class which encapsulates this behavior at the 
PHP code exchange...

http://px.sklar.com/code-pretty.html?code_id=233

It allows the sending of text, html and attachments...