1

我为我的班级设置了一个连续的项目,可以在线上供学生和家长互动。所以我要求学生每天通过电子邮件发送他们的项目进度。我使用 imap 获取信息并在线显示。

我了解电子邮件地址可能会被欺骗。我怎样才能知道邮件是否真的来自 yahoo、gmail 或 hotmail。我可以使用哪个 imap 功能。我试过这个

imap_headerinfo($inbox, $emails[$x])

但它没有给我它通过的服务器的 IP 地址。

我很感激任何帮助。

4

1 回答 1

4
$mailinfo = imap_headerinfo($inbox, $emails[$x]);
print_r($mailinfo->from);

应该给你: personal, adl, mailbox, and host

以下任何内容都可以帮助您$mailinfo->...:(
有关完整参考,请查看http://php.net/manual/en/function.imap-headerinfo.php

->to - an array of objects from the To: line, with the following properties: personal, adl, mailbox, and host

->from - an array of objects from the From: line, with the following properties: personal, adl, mailbox, and host

->ccaddress - full cc: line, up to 1024 characters

->cc - an array of objects from the Cc: line, with the following properties: personal, adl, mailbox, and host

->bccaddress - full bcc: line, up to 1024 characters

->bcc - an array of objects from the Bcc: line, with the following properties: personal, adl, mailbox, and host

->reply_toaddress - full Reply-To: line, up to 1024 characters

->reply_to - an array of objects from the Reply-To: line, with the following properties: personal, adl, mailbox, and host

->senderaddress - full sender: line, up to 1024 characters

->sender - an array of objects from the Sender: line, with the following properties: personal, adl, mailbox, and host

->return_pathaddress - full Return-Path: line, up to 1024 characters

->return_path - an array of objects from the Return-Path: line, with the following properties: personal, adl, mailbox, and host

为什么主机名很重要: 在此处输入图像描述

(抱歉,坐在火车上,图像不稳定)

于 2013-02-06T12:02:30.667 回答