以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  [求助]邮件发送失败  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=88976)

--  作者:mxko
--  发布时间:2016/8/12 17:15:00
--  [求助]邮件发送失败
如题:用下面代码 在香港 发送邮件时出错,在国内没问题 ,请大侠们帮忙
Dim m As New MailSender
m.Host = "mail.grand-metal.com"
m.Account = FromEMail
m.Password = EMailPassword 
m.From = FromEMail 
m.To = ToEMail
m.Title = EMailTitle
m.Content = EMailContent
m.Send()


图片点击可在新窗口打开查看此主题相关图片如下:邮件错误.jpg
图片点击可在新窗口打开查看


--  作者:大红袍
--  发布时间:2016/8/12 18:08:00
--  

 应该是用到了 SSL 安全,试试

 

Dim client As New System.Net.Mail.SmtpClient("smtp.qq.com", 25)
client.EnableSsl = True \'SSL
client.Credentials = New System.Net.NetworkCredential("455189993@qq.com", "helen6849338.")
client.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network
Dim message As New System.Net.Mail.MailMessage()

message.From = new System.Net.Mail.MailAddress("455189993@qq.com","别名")

message.To.Add(new System.Net.Mail.MailAddress("2450314695@qq.com","人名"))
message.To.Add("2450314695@qq.com")
message.Subject = "邮件测试"
message.BodyEncoding = System.Text.Encoding.UTF8

Dim content As String

content &= "这是文字" & vbcrlf
content &= "也是文字"

message.Body = content

Try
    client.Send(message)
    msgbox("发送成功")
Catch ex As Exception
    msgbox("发送失败:" & ex.message)
End Try


--  作者:mxko
--  发布时间:2016/8/13 9:02:00
--  
谢谢大红袍的回答