I want to download to get the following information from my emails

sender
sender_email_address
subject
Message
attachments = array(
       all attachments
)

any library? suggestions? links?

有帮助吗?

解决方案 2

Here is the library that can be used..

http://garrettstjohn.com/entry/reading-emails-with-php/

plus accessing the library, extracting email and its attachments

http://garrettstjohn.com/entry/extracting-attachments-from-emails-with-php/

Something that was missing in this extraction, was a function to process image, so I had to do it...

function _process_img($attach, $ext){

    $directory = "uploads";

    $path=realpath(APPPATH."../".$directory);
    $file_name="any_name_you_want_to_give".".".$ext;

    $file=$directory.$file_name;
    if(file_put_contents($path."/".$file_name, $attach)) return $file;
}

Hope it will help someone else too...

其他提示

I have used https://github.com/EllisLab/CodeIgniter/wiki/IMAP and it worked just fine.

Good luck

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top