下面这一段代码,用公司自己的邮箱发送,可以成功发送。但请问如何用163免费邮发送,我已经开通smtp服务了。
'------------发送邮件开始
Dim client As New System.Net.Mail.SmtpClient()
client.Host ="smtp.ym.163.com"
client.Credentials = New System.Net.NetworkCredential(用户名),(密码)) '
client.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network
Dim message As New System.Net.Mail.MailMessage()
message.From = new System.Net.Mail.MailAddress("邮箱名称")
message.To.add("dtcq@163.com")
'以下为项目进度发送内容
message.Subject =“”“进度”
message.BodyEncoding = System.Text.Encoding.UTF8
Dim content As String
content &= "本项目 进度:" & vbcrlf
message.Body = content
Try
client.Send(message)
messagebox.show("发送成功","邮件")
Catch ex As Exception
messagebox.show("发送失败:" & ex.message ,"邮件")
End Try
'------------发送邮件结束