以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  MailSender如何验证发件人邮箱账户是否正确?  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=134923)

--  作者:xluoping
--  发布时间:2019/5/13 10:26:00
--  MailSender如何验证发件人邮箱账户是否正确?
MailSender 如何验证发件人邮箱账户是否正确?

如:验证Host、Account、Password是否能成功发送邮件?

Dim m As New MailSender
m
.Host = "smtp.qq.com"
m
.EnableSsl = True \'必须将EnableSsl属性设置为True
m
.Account = "apple@qq.com"
m
.Password = "c409ddc47aa74638" \'注意这不是QQ密码,是授权码
m
.From = "apple@qq.com"
m
.To = "1234567@qq.com"
m
.Title = "李总明天来北京"
m
.Content = "航班号是gz1234,上午11点到达,请注意接机"
m
.Send()

--  作者:有点甜
--  发布时间:2019/5/13 10:34:00
--  

检测最后是否发送成功即可

 

try
    Dim m As New MailSender
    m.port = "587"
    m.EnableSsl = True
    m.Host = "smtp.qq.com"
    m.Account = "455189993@qq.com"
    m.Password = "helen6849338."
    m.From = "455189993@qq.com"
    m.To = "abc12399943kdiccde@qq.com"
    m.Title = "初jkj完成"
    m.Content = "附件jkjkj为初稿, 请您审阅!"
    m.Send
    msgbox("ok")
catch e As Exception
    msgbox(e.message)
End try