找回密码
 加入
搜索
查看: 2097|回复: 4

_INetSmtpMail设置后报错!

[复制链接]
发表于 2008-9-6 17:27:58 | 显示全部楼层 |阅读模式
_INetSmtpMail设置后报错!
不知道为什么!
请大侠指出!
谢谢!



源码如下:
#include <INet.au3>

$s_SmtpServer = "smtp.gmail.com"
$s_FromName = "My Name"
$s_FromAddress = "*@gmail.com";*帐号
$s_ToAddress = "*@gmail.com";*帐号
$s_Subject = "My Test UDF"
Dim $as_Body[2]
$as_Body[0] = "Testing the new email udf"
$as_Body[1] = "Second Line"
$Response = _INetSmtpMail ($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body)
$err = @error
If $Response = 1 Then
    MsgBox(0, "Success!", "Mail sent")
Else
    MsgBox(0, "Error!", "Mail failed with error code " & $err)
EndIf


[ 本帖最后由 sark 于 2008-9-19 20:12 编辑 ]
 楼主| 发表于 2008-9-9 16:32:20 | 显示全部楼层
没人回答!顶一下!
发表于 2008-9-9 17:18:41 | 显示全部楼层
$err是什么?
@ERROR = 1 - Invalid Parameters
    @ERROR = 2 - Unable to start TCP
    @ERROR = 3 - Unable to resolve IP
    @ERROR = 4 - Unable to create socket
    @ERROR = 5x - Cannot open SMTP session. x indicates the index number of last command issued to the SMTP server.
    @ERROR = 50x - Cannot send body. x indicates the line number of $as_Body (first line is 0).
    @ERROR = 5000 - Cannot close SMTP session

还有 gmail的smtp服务器需要登陆才可以用
发表于 2008-9-9 17:23:11 | 显示全部楼层
我刚才试了一下 提示错误代码4  无法创建socket
发表于 2008-9-9 17:27:59 | 显示全部楼层
现在的SMTP一般都需要验证的,_INetSmtpMail这个函数现在没多大用处了,如果需要的话,可以看看这篇,支持GMAIL
http://www.1msoft.com/column/UDF-hanshu/SmtpMailer.html
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-11 20:20 , Processed in 0.070312 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表