PHP Script to save email attachments
$100-150 USD
Pagado a la entrega
This project is for a PHP script / function that will loop through an email inbox (connecting with either POP3 or IMAP), and save any attachments to a folder and return an array of the paths to the attachment files saved, along with the FROM, TO, SUBJECT and BODY text of the email message.
No user interface is needed - jus the script that performs the above function.
A more detailed technical description is below.
## Deliverables
The function should look like:
function SaveEmailAttachments($server, $username, $password, $port, $imap, $path, $start_date, $end_date)
Where $server, $username, $password, $port are used to log in to the email service ($imap is true for IMAP and false for POP3).
$path is the folder to save attachments to. The filename used to save the attachment should be md5($TO.$FROM.$DATE.$SUBJECT.$ORIGINAL_FILENAME) If the file already exists in $path, the email should be skipped (no attachment saved).
Only emails that with received-on dates on or between $start_date and $end_date (format: yyyy-mm-dd) should have their attachments saved.
The function should return an array describing the emails saved. Each item in the array should contain the details: TO, FROM, DATE, BODY, FILENAME, PATH. Where TO AND FROM are in the form "<Bob Smith> bob@[url removed, login to view]; <Suzy Jones> suzy@[url removed, login to view]". BODY is the text of the email body (if the email is in HTML format, return just the text after stripping the HTML tags). FILENAME is the original filename of the attachment and PATH is the full path to the saved file.
Please let me know if their are any other questions.
Nº del proyecto: #3603289