首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何读取传入电子邮件的ip地址

如何读取传入电子邮件的ip地址
EN

Stack Overflow用户
提问于 2013-02-06 11:38:09
回答 1查看 1.7K关注 0票数 1

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

我知道电子邮件地址可能会被欺骗。我怎样才能找到邮件是否真的来自雅虎,gmail或hotmail。我可以使用哪种imap功能。我试过这个

imap_headerinfo($inbox,$emails$x)

但是它并没有给我它通过的服务器的ip地址。

我很感谢你的帮助。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-02-06 12:02:30

代码语言:javascript
运行
复制
$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

为什么主机名是重要的:

(不好意思,坐在火车上的形象不稳定)

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14728131

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档