首页 > 解决方案 > 无法验证 Outlook server.mail() 参数问题的电子邮件

问题描述

这是我上一个问题的延续,无法检查域的 mx 记录,例如 yahoo 和 Outlook 等 ,我遇到了异常

outlook-com.olc.protection.outlook.com.
mail() takes at least 2 arguments (1 given)

对于雅虎,我也遇到了同样的例外

mta5.am0.yahoodns.net.
mail() takes at least 2 arguments (1 given)


我的脚本验证的完整代码是这样的:
https ://github.com/Rwarlock/mxrecordchecker/blob/master/mxrecord.py

我应该使用什么参数才能连接到这个(outlook)域?
我在这里想念什么?


更新

我更新了参数,

server.mail('bhanu@krenovate.com',email)

现在我收到了这个错误:

outlook-com.olc.protection.outlook.com.
Connection unexpectedly closed


更新 2
我能够连接到雅虎,但仍然无法调试 Outlook。

outlook-com.olc.protection.outlook.com.
connect: ('outlook-com.olc.protection.outlook.com.', 25)
connect: ('outlook-com.olc.protection.outlook.com.', 25)
reply: '220 DB5EUR01FT021.mail.protection.outlook.com Microsoft ESMTP MAIL Service ready at Thu, 14 Feb 2019 07:47:10 +0000\r\n'
reply: retcode (220); Msg: DB5EUR01FT021.mail.protection.outlook.com Microsoft ESMTP MAIL Service ready at Thu, 14 Feb 2019 07:47:10 +0000
connect: DB5EUR01FT021.mail.protection.outlook.com Microsoft ESMTP MAIL Service ready at Thu, 14 Feb 2019 07:47:10 +0000
send: 'helo www.outlook.com\r\n'
reply: '250 DB5EUR01FT021.mail.protection.outlook.com Hello [14.143.8.238]\r\n'
reply: retcode (250); Msg: DB5EUR01FT021.mail.protection.outlook.com Hello [14.143.8.238]
send: 'mail FROM:<bhanukrsingh@outlook.com>\r\n'
reply: '550 5.7.1 Service unavailable, Client host [14.143.8.238] blocked using Spamhaus. To request removal from this list see https://www.spamhaus.org/query/ip/[14.143.8.238] (AS3130). [DB5EUR01FT021.eop-EUR01.prod.protection.outlook.com]\r\n'
reply: retcode (550); Msg: 5.7.1 Service unavailable, Client host [14.143.8.238] blocked using Spamhaus. To request removal from this list see https://www.spamhaus.org/query/ip/[14.143.8.238] (AS3130). [DB5EUR01FT021.eop-EUR01.prod.protection.outlook.com]
send: 'rcpt TO:<bhanukrsingh@outlook.com>\r\n'
Connection unexpectedly closed

我正在接收此调试数据。列表中的一个测试域也抛出了这个

mail.pmrelocations.com.
connect: ('mail.pmrelocations.com.', 25)
connect: ('mail.pmrelocations.com.', 25)
reply: '451-The server has reached its limit for processing requests from your host. \r\n'
reply: '451 Please try again later.\r\n'
reply: retcode (451); Msg: The server has reached its limit for processing requests from your host.
Please try again later.
connect: The server has reached its limit for processing requests from your host.
Please try again later.
send: 'helo www.outlook.com\r\n'
Connection unexpectedly closed

标签: pythonoutlooksmtpsmtp-auth

解决方案


推荐阅读