Codeigniter访问带有图像作为附件的电子邮件(pop3-imap)


Codeigniter access emails with Image as attachments (pop3 imap)

我想下载以从我的电子邮件中获得以下信息

sender
sender_email_address
subject
Message
attachments = array(
       all attachments
)

有图书馆吗?建议?链接?

我使用过https://github.com/EllisLab/CodeIgniter/wiki/IMAP而且效果很好。

祝好运

这是可以使用的库。。

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

加上访问图书馆,提取电子邮件及其附件

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

这次提取中缺少的是一个处理图像的功能,所以我不得不这样做…

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;
}

希望它也能帮助其他人。。。