Jump to content

Extracting Email Attachment (Text)


TripleDES

Recommended Posts

What's the best way to extract email attachments that's encoded in base64?  I can run the base64 encoded stuff through base64_decod(), but I want to know if there is a function to handle attachments.

 

Example:

------_=_NextPart_001_01C7C330.9D7B678C
Content-Type: text/plain;
name=report.csv
Content-Transfer-Encoding: base64
Content-Description: report_=.csv
Content-Disposition: inline;
filename=report.csv

Link to comment
https://forums.phpfreaks.com/topic/59320-extracting-email-attachment-text/
Share on other sites

Thanks.  I did find several mail parsing functions through pecl, but several of them are undocumented.

 

mailparse_determine_best_xfer_encoding — Gets the best way of encoding

mailparse_msg_create — Create a mime mail resource

mailparse_msg_extract_part_file — Extracts/decodes a message section

mailparse_msg_extract_part — Extracts/decodes a message section

mailparse_msg_extract_whole_part_file — Extracts a message section including headers without decoding the transfer encoding

mailparse_msg_free — Frees a MIME resource

mailparse_msg_get_part_data — Returns an associative array of info about the message

mailparse_msg_get_part — Returns a handle on a given section in a mimemessage

mailparse_msg_get_structure — Returns an array of mime section names in the supplied message

mailparse_msg_parse_file — Parses a file

mailparse_msg_parse — Incrementally parse data into buffer

mailparse_rfc822_parse_addresses — Parse RFC 822 compliant addresses

mailparse_stream_encode — Streams data from source file pointer, apply encoding and write to destfp

mailparse_uudecode_all — Scans the data from fp and extract each embedded uuencoded file

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.