|
@@ -24,8 +24,17 @@ class Msg extends Controller
|
|
|
__DIR__, // Directory, where attachments will be saved (optional)
|
|
__DIR__, // Directory, where attachments will be saved (optional)
|
|
|
'UTF-8' // Server encoding (optional)
|
|
'UTF-8' // Server encoding (optional)
|
|
|
);
|
|
);
|
|
|
-
|
|
|
|
|
- $mail_ids = $mailbox->searchMailbox('FROM txt.voice.google.com');
|
|
|
|
|
|
|
+ $num=$this->getQuery()->string("num","6288883915");
|
|
|
|
|
+ $from_google=false;
|
|
|
|
|
+ if ($num=="6288883915"){
|
|
|
|
|
+ $mail_ids = $mailbox->searchMailbox('FROM txt.voice.google.com');
|
|
|
|
|
+ $from_google=true;
|
|
|
|
|
+ }else{
|
|
|
|
|
+ if ($num=="6285000156"){
|
|
|
|
|
+ $mail_ids = $mailbox->searchMailbox('FROM textnow.me');
|
|
|
|
|
+ $from_google=false;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
// $mail_info = $mailbox->getMailsInfo($mail_ids);
|
|
// $mail_info = $mailbox->getMailsInfo($mail_ids);
|
|
|
$mail_info=[];
|
|
$mail_info=[];
|
|
|
$mail_ids=array_reverse($mail_ids);
|
|
$mail_ids=array_reverse($mail_ids);
|
|
@@ -46,14 +55,20 @@ class Msg extends Controller
|
|
|
$temp=$cache->get($key);
|
|
$temp=$cache->get($key);
|
|
|
if (!$temp) {
|
|
if (!$temp) {
|
|
|
$detail = $mailbox->getMail($mail_id);
|
|
$detail = $mailbox->getMail($mail_id);
|
|
|
- $txt = explode("\r\n", $detail->textPlain);
|
|
|
|
|
|
|
+ if ($from_google){
|
|
|
|
|
+ $from_num=$detail->fromName;
|
|
|
|
|
+ $txt = explode("\r\n", $detail->textPlain)[1];
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $from_num=str_replace("Message from ", "", $detail->subject);
|
|
|
|
|
+ $txt=$detail->textPlain;
|
|
|
|
|
+ }
|
|
|
$temp = [
|
|
$temp = [
|
|
|
'subject' => $detail->subject,
|
|
'subject' => $detail->subject,
|
|
|
- 'content' => $txt[1],
|
|
|
|
|
|
|
+ 'content' => $txt,
|
|
|
'from' => $detail->fromAddress,
|
|
'from' => $detail->fromAddress,
|
|
|
- 'fromName' => $detail->fromName,
|
|
|
|
|
|
|
+ 'fromName' => $from_num,
|
|
|
'replyTo' => $detail->replyTo,
|
|
'replyTo' => $detail->replyTo,
|
|
|
- 'date' => $detail->date,
|
|
|
|
|
|
|
+ 'date' =>$detail->date,
|
|
|
'cc' => $detail->cc,
|
|
'cc' => $detail->cc,
|
|
|
'bcc' => $detail->bcc,
|
|
'bcc' => $detail->bcc,
|
|
|
];
|
|
];
|
|
@@ -66,6 +81,7 @@ class Msg extends Controller
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
$this->result=$mail_info;
|
|
$this->result=$mail_info;
|
|
|
|
|
+ $this->num=$num;
|
|
|
$this->render();
|
|
$this->render();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|