这样发本地可以,放到服务器上报错,确认是管理员权限
Public Function email_send( mailname As String, content As String ) As Boolean
Dim m As New MailSender
Dim drdeploy As DataRow = DataTables("prot_deploy").sqlfind("deid = 1")
If drdeploy IsNot Nothing Then
m.Host = drdeploy("desmtpserver")
m.EnableSsl = True '必须将EnableSsl属性设置为True
m.Account = drdeploy("desmtpuser")
m.Password = drdeploy("desmtppass")'注意这不是QQ密码,是授权码
m.From = drdeploy("desmtpuser")
m.To = mailname
m.Title = "【昱帝电商】验证码"
m.Content = content
m.Send()
'm.SendAsync()
email_send = True
Else
email_send = False
End If
End Function
[此贴子已经被作者于2017/5/2 22:26:37编辑过]