仅从IMAP消息中获取答复 [英] Getting only the reply from IMAP message

查看:51
本文介绍了仅从IMAP消息中获取答复的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前,我正在建立一个系统来跟踪我的电子邮件,但是我不希望显示原始消息.

Currently I'm making a system to track my emails, however I don't wish to have the original message displayed.

是否有一种方法可以请求IMAP仅返回答复?不是全部(当您按下从任何电子邮件客户端回复电子邮件时,会将原始电子邮件添加到底部).还是通过PHP本身完成?我目前有

Is there a way to request IMAP to return only the reply? not the entire(when you press reply to an email from any email client, it adds the original email to the bottom). Or do it via PHP itself? I currently have

$msg = nl2br($msg);
        $msgs2 = explode("<br />", $msg);
        //pre($msgs2);

        foreach($msgs2 as $msg) {
            if(strpos($msg, '> ') === false) $message .= "<br>".$msg;
        }
        return $message;

但是,如果您查看原始的Gmail回复,则其中包含诸如HTML版本之类的内容.

However if you look at raw gmail reply, it has thing ssuch as HTML version etc..

> --f46d0442889037c1fc04b6c20955 Content-Type: text/plain; charset=ISO-8859-1
> 
> fghjfghjfgh test test eteststs
> 
> On Tue, Jan 17, 2012 at 11:35 PM, mm <
> mg.com> wrote:
> 
> >
> > On 17 Jan 2012, at 05:56, mom wrote:
> >
> > > Another email hahahahqa!
> > > On 17 Jan 2012, at 05:47, mcom wrote:
> > >
> > >> Test message, higgins is very fat
> > >>
> > >>
> > >>
> > >>
> > >>
> > >> Please do not edit below
> > >> *************************
> > >> S
> > >
> >
> >
> 
> 
> --  
> 
> --f46d0442889037c1fc04b6c20955 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
> 
> fghjfghjfgh test test eteststs<br><br><div class=3D"gmail_quote">On
> Tue, Ja= n 17, 2012 at 11:35 PM, <a
> href=3D"mailto:maom">mm</a>
> <span dir=3D"ltr">&lt;<a href=3D"mailto:mn=
> g.com">ma</a>&gt;</span> wrote:<br> <blockquote
> class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x
> #ccc solid;padding-left:1ex"><br> On 17 Jan 2012, at 05:56, <a href=3D"mailto:.com">mag.com</a>
> wrote:<br> <br> &gt; Another email hahahahqa!<br> &gt; On 17 Jan 2012,
> at 05:47, <a href=3D"mailto:.com">ma=
> na.com</a> wrote:<br> &gt;<br> &gt;&gt; Test message,
> higgins is very fat<br> &gt;&gt;<br> &gt;&gt;<br> &gt;&gt;<br>
> &gt;&gt;<br> &gt;&gt;<br> &gt;&gt; Please do not edit below<br>
> &gt;&gt; *************************<br> &gt;&gt; S<br> &gt;<br> <br> </blockquote></div><br><br
> clear=3D"all"><div><br></div>-- <br>Regards,<div=
> >,</div><div>=A0</div><br>
> 
> --f46d0442889037c1fc04b6c20955--

但是那只是gmail,还有很多其他电子邮件客户端,依此类推,有人可以帮忙吗?

But thats just gmail, there are a lot of other email clients and so on, anyone could help?

推荐答案

目前尚无用于引用电子邮件的通用标准格式-所有电子邮件客户端(包括GMail)都有自己的发现回复"内容的方式.因此,IMAP无法仅获取消息中的答复".

There is no universal standard format for quoting in email messages -- all email clients, including GMail, have their own ways of discovering what constitutes a "reply". As such, IMAP has no way to fetch only the "reply" in the message.

这篇关于仅从IMAP消息中获取答复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆