douyi6755 2012-04-02 06:15
浏览 341
已采纳

如何使用getmxrr获取邮件服务器的主机名,IP地址?

From the phpmanual, the getmxrr( get mx record) is a bool value, it is true if the record exist.

However, i would like to get more information about the mail domain, for example:

A simple mx lookup record (hotmail) is like this:

Pref    Hostname    IP Address  TTL     
5   mx1.hotmail.com 65.55.92.152    60 min  
5   mx2.hotmail.com 65.55.92.152    60 min  
5   mx3.hotmail.com 65.54.188.110   60 min  
5   mx4.hotmail.com 65.55.92.136    60 min  

Can i obtain the above information using getmxrr?

Thank you.

  • 写回答

1条回答 默认 最新

  • dsdf64562672 2012-04-02 06:18
    关注

    Second parameter gives mx host list:

    $hosts = array();
    getmxrr('hotmail.com', $hosts);
    var_dump($hosts);
    

    getmxrr

    to get and ip adresses simple request for it with gethostbyname

     foreach($hosts as $host) {
         echo $host . ' ' . gethostbyname($host) . '<br />';
     }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 关于大棚监测的pcb板设计
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥15 帮我写一个c++工程