设置属性
message.Priority = System.Net.Mail.MailPriority.High '邮件的优先级,有三个值:高(在邮件主题前有一个红色感叹号,表示紧急),低(在邮件主题前有一个蓝色向下箭头,表示缓慢),正常(无显示)
https://msdn.microsoft.com/zh-cn/library/ms223213.aspx
Dim client As New System.Net.Mail.SmtpClient()
client.Host = "smtp.qq.com"
client.Credentials = New System.Net.NetworkCredential("lin_hailun@qq.com", "helen6849338.")
client.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network
Dim message As New System.Net.Mail.MailMessage("lin_hailun@qq.com", "765427475@qq.com")
message.Subject = "邮件测试"
message.BodyEncoding = System.Text.Encoding.UTF8
message.Priority = System.Net.Mail.MailPriority.High '邮件的优先级,有三个值:高(在邮件主题前有一个红色感叹号,表示紧急),低(在邮件主题前有一个蓝色向下箭头,表示缓慢),正常(无显示)
'message.Bcc.Add("2450314695@qq.com") '密送
'message.cc.Add("2450314695@qq.com") '抄送
Dim content As String
content &= "这是文字" & vbcrlf
content &= "也是文字"
message.Body = content
Try
client.Send(message)
msgbox("发送成功")
Catch ex As Exception
msgbox("发送失败:" & ex.message)
finally
message.Dispose()
End Try