本帖最后由 五猫橙 于 2009-10-12 07:48 编辑
6# ainizm
此乃GMAIL版本..163的请自行设置#include <SmtpMailer.au3>
$s_SmtpServer = "smtp.gmail.com" ;SMTP服务器
$s_FromName = "username@gmail.com" ;邮件发送人
$s_FromAddress = "username@gmail.com" ;邮件发送者地址
$s_ToAddress = "getter@gmail.com" ;收件人地址
$s_Subject = "测试" ;邮件标题
$as_Body = "测试" ;邮件正文
$s_AttachFiles = "" ;附件地址
$s_CcAddress = "" ;抄送地址
$s_BccAddress = "" ;密件抄送地址
$s_Username = "username@gmail.com" ;用户名
$s_Password = "password" ;密码
$IPPort = 465 ;发送端口,Gmail使用的发送端口为465
$ssl = 1
Func sendmail()
Global $oMyRet[2]
Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")
$rc = _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body, $s_AttachFiles, $s_CcAddress, $s_BccAddress, $s_Username, $s_Password, $IPPort, $ssl)
If @error Then
MsgBox(0, "邮件发送失败", "错误代号:" & @error & " 描述:" & $rc)
EndIf
EndFunc
修正:请在15行加上sendmail() |