Dim Message As New MailMessage
Message.IsBodyHtml = True
Message.SubjectEncoding = ASCIIEncoding.GetEncoding( "gb2312 ")
Message.BodyEncoding = ASCIIEncoding.GetEncoding( "gb2312 ")
'//收件人
Message.To.Add( "shengwife@163.com ")
'//发信人
Message.From = New MailAddress( "xingfengyoushang@163.com ", "kevin ")
'//标题
Message.Subject = "邮件测试 "
'//邮件内容
Message.Body = "测试邮件! <BR> 可以吗! "
Dim smtpClient As New SmtpClient
'//指定smtp服务器
smtpClient.Host = "smtp.163.com "
smtpClient.Port = 25
'//smtp服务器使用身份认证
smtpClient.UseDefaultCredentials = True
'//设置认证信息
Dim cfm As New Net.NetworkCredential( "xingfengyoushang@163.com ", "123456 ", "smtp.163.com ")
smtpClient.Credentials = cfm
smtpClient.Send(Message)
这是发邮件的代码,但是运行出现以下错误:
异常详细信息: System.Net.Mail.SmtpException: 事务失败。 服务器响应为: HL:ITC 0,smtp9,wKjAELA7FAbC8yJGzsjIKQ==.61364S0 1176695746 http://mail.163.com/help/help_spam_16.htm
请问我该怎样解决?
------解决方案--------------------------------------------------------
学习