douli6605 2016-12-07 12:11 采纳率: 100%
浏览 29

webrivers - 无法使用php从电子邮件接收内嵌图像

I am trying to retrieve email using php mail but i am unable to recieve Inline images. I am able to recieve text but not recieved images.

Below is code i have tried :

<?php
$emailAddress = "domain@domian.com"; 
$emailPassword = "password";
$domainURL = 'domian.com';
$useHTTPS = true;
$inbox = imap_open('{'.$domainURL.':143/notls}INBOX',$emailAddress,$emailPassword) or die('Cannot connect to domain:' . imap_last_error());
$emails = imap_search($inbox,'UNSEEN');
if($emails) {
rsort($emails);
foreach($emails as $email_number) {
$overview = imap_fetch_overview($inbox,$email_number,0);
$header = imap_headerinfo($inbox, $email_number);
echo $subject_other= $overview[0]->subject;
echo $sender_name_other= $overview[0]->from;
echo $date_other=$overview[0]->date;
echo $msg_to_other=$overview[0]->to;
echo $msg_from_other = $header->from[0]->mailbox . "@" . $header->from[0]->host;
$message = imap_fetchbody($inbox, $email_number, 2);
echo $message;
}
} 
imap_close($inbox);
?>

only receive text mail, cannot receive inline images how to fix it...please help me...

  • 写回答

3条回答 默认 最新

  • doushi7394 2016-12-07 12:14
    关注

    You need to specify header for sending images in mail.

    评论

报告相同问题?

悬赏问题

  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?
  • ¥15 matlab(相关搜索:紧聚焦)
  • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计
  • ¥15 Arduino无法同时连接多个hx711模块,如何解决?
  • ¥50 需求一个up主付费课程
  • ¥20 模型在y分布之外的数据上预测能力不好如何解决