|
各位好:我把帮助文件里的 _INetSmtpMail 函数示例复制了一份,根据实际的情况修改了SMTP服务器地址,发件人,收件人但是运行时提示 50的错误代码,请各位指点一下,多谢了。
代码如下,
#include<inet.au3>
#include <MsgBoxConstants.au3>
Local $s_SmtpServer = "112.4.69.138"
Local $s_FromName ="testuser"
Local $s_FromAddress = "bill.chen@jskwt.com"
Local $s_ToAddress = "13771959288@139.com"
Local $s_Subject = "test send mail"
Local $as_Body[2]
$as_Body[0] = "测试新的电子邮件 UDF"
$as_Body[1] = "第二行"
;Local $iResponse = _INetSmtpMail($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body)
Local $iResponse = _INetSmtpMail($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress)
Local $iErr = @error
If $iResponse = 1 Then
MsgBox($MB_SYSTEMMODAL, "成功!", "邮件已发送")
Else
MsgBox($MB_SYSTEMMODAL, "错误!", "邮件失败,错误代码 " & $iErr)
EndIf |
|