I have seen on various ASP.NET tutorials that the following line in the auto eMail code should produce a high priority symbol in the message listing in the recipient's eMail program (e.g. Outlook Express):
mailMessage.Priority = MailPriority.High
However, when I try it, I get "Compiler Error Message: BC30451: Name 'MailPriority' is not declared." Where and how do I need to declare it? I give the complete code below:
Dim mailMessage As System.Web.Mail.MailMessage = New System.Web.Mail.MailMessage
mailMessage.From = "Tests<tests@dotnet.itags.org.mydomain.co.uk>"
mailMessage.To = "RedcarJohn<redcarjohn@dotnet.itags.org.lycos.co.uk>"
mailMessage.Subject = "Testing mail priority setting"
mailMessage.BodyFormat = System.Web.Mail.MailFormat.Html
mailMessage.Priority = MailPriority.High
mailMessage.Body = "<font face='Arial' size='2'>This eMail should have a high priority mark.</font>"
System.Web.Mail.SmtpMail.SmtpServer = "www.myhoster.co.uk"
System.Web.Mail.SmtpMail.Send(mailMessage)
Regards
RedcarJohn
mailMessage.Priority = MailPriority.High
to:
mailMessage.Priority = System.Web.Mail.MailPriority.High
Thanks for your very quick suggestion. I have tried it but it has made no difference. The eMail arrived OK but without the exclamation mark. Any other ideas?
Regards
RedcarJohn
0 comments:
Post a Comment