如何在vb.net中发送具有高重要性的邮件

时间:2013-08-18 10:56:17

标签: vb.net email

我有发送电子邮件的代码:

Try
            Dim SmtpServer As New SmtpClient()
            SmtpServer.Credentials = New Net.NetworkCredential("jasibs002@gmail.com", "solutions")
            SmtpServer.Port = 25
            SmtpServer.Host = "smtp.gmail.com"
            SmtpServer.EnableSsl = True
            Dim omail As New MailMessage()
 omail.From = New MailAddress("jasibs002@gmail.com", "JaseemBinBacker", System.Text.Encoding.UTF8)

            omail.Subject = "test subject"
            omail.Body = "Hai How Are You I am Sendig This Mail for Testing"
            '  omail.To.Add("jaseem@ibsdubai.ae")
            omail.To.Add(txtEmail.Text)

            SmtpServer.SendAsync(omail, Nothing)
 Catch ex As Exception
            MsgBox(ex.ToString)
        End Try

这项工作正常,但向outlook发送电子邮件是否有任何提及“高重要性”的方法?我附上一张高重要性电子邮件enter image description here的图片。就像那个红色的感叹号,我想在这里做什么?

2 个答案:

答案 0 :(得分:2)

答案 1 :(得分:1)

MailMessage类中有一个Priority属性,您可以使用以下枚举填充: 高 低 正常

所以你可以把它设置为:

omail.Priority = MailPriority.High