PHP e-mail reader

We need a small PHP command line script that reads a POP3 account and extract attatchments and saves them to a folder. The code should be in a function so that the script is easy to include and call from other scripts.

## Deliverables

We need php command line script containing with a function that:

1) Logs on to a POP3 account and download messages one by one

2) If the message contains an attachment with a specified name, it should be stored to a folder. A number must be added to the file to be sure it is unique and an existing file with the same name is not overwritten.

3) The function should return an array containing the names of all stored files This should be the name the file is saved with, not the original name of the file.

4) All the mails from which a file is saved, should be marked as read and deleted from the POP3 mailbox so that a file is never saved twice.

5) Code shoud be well documented so that is easy for another coder to understand what the code is doing.

Example PHP code:


$file_names = download_attachments('[url removed, login to view]', 'name', 'pwd', '[url removed, login to view]', '/tmp/');

echo "Saved files: \n";

foreach($file_names as $file_name){

echo $file_name . "\n";


function download_attachments($pop3_server, $pop3_user, $pop3_password, $attachment_filename_regex, $save_to_folder){

? ? //Log on server

? ? ?

? ? //Iterate through messages:

? ? ?

? ? //If attachment exixsts and attachment filename match $attachment_filename_regex :

? ? ? ? ? ? //If filemname already exists in folder:

? ? ? ? ? ? //Find a running number to add before the file ending like this

? ? ? ? ? ? //[url removed, login to view], [url removed, login to view], [url removed, login to view]

? ? ? ? //Save attatchment as selected filename

? ? ? ? //Mark message as read/to be deleted

? ? ? ? //Store filename in array

? ? ? ?

? ? //Return array of filenames

? ? ?



Habilidades: Engenharia, MySQL, PHP, Arquitetura de software, Teste de Software

Veja mais: mail on line, script reader, e mail com, download php coder, php command, php code test, find reader, file reader, php download zip files, php file array, pop3 mail server, php download files zip, php mail test script, download file php zip, read call logs, php log report, pop3 attachment, extract filename, php download zip, php code example, zip folder script, php script echo, download attachment code, code download attachment, php array file

Acerca do Empregador:
( 2 comentários ) Norway

ID do Projeto: #3061727

Concedido a:


See private message.

$25.5 USD em 14 dias
(11 Comentários)

6 freelancers estão ofertando em média $54 para esse trabalho


See private message.

$68 USD in 14 dias
(64 Comentários)

See private message.

$79.9 USD in 14 dias
(34 Comentários)

See private message.

$85 USD in 14 dias
(23 Comentários)

See private message.

$42.5 USD in 14 dias
(8 Comentários)

See private message.

$25.5 USD in 14 dias
(0 Comentários)