Click to See Complete Forum and Search --> : Can ASP specify Outlook Email Importance Level?


baldwingrand
04-04-2008, 05:01 PM
In Outlook emails, I know you can specify a message having high importance. I am wondering if there is a way to use ASP to do that. For example, I have some code that sends out an email via a website. The user fills basically fills out some information on the page, then that information is sent to a recipient in email. What I'd like is for ASP to specify that the email have the importance, or priority, of the email. So that when the recipient receives the email, it is marked as high or normal importance automatically. Does anyone know if this can be done? My code is below. Thanks.


if Request.TotalBytes > 0 then

Dim upload
Dim sTo
sTo = ""
Dim sCC
Dim sCC2
sCC = ""
sCC2 = ""
set upload = Server.CreateObject("Persits.Upload.1")
Dim count
Dim i
Dim file
Dim documentName
Dim documentPath
documentPath = Server.MapPath("/") & ("\uploads")
count = upload.Save(documentPath)
Dim iMsg
Set iMsg = CreateObject("CDO.Message")
Dim iConf
Set iConf = CreateObject("CDO.Configuration")
Dim Flds
Set Flds = iConf.Fields


With Flds
.Item("http://schemas.microsoft.com/cdo/" &_
"configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/" &_
"configuration/smtpserver") = "localhost"
.Item("http://schemas.microsoft.com/cdo/" &_
"configuration/smtpserverport") = 25
.Update
End With


'** Check Group 1**'
if upload.form("cbGroupOne") = "1" Then
sTo = sTo & test@test.com
End if

'** Check Group 2**'
if upload.form("cbGroupTwo") = "1" Then
sTo = sTo & test@test.com
End if


With iMsg
Set .Configuration = iConf
.To = sTo
.CC = sCC & sCC2
.From = upload.form("txtrequestorLAN") & "@test.com"
.Subject = upload.form("txtSubject")
.HTMLBody = .HTMLBody & "This email was generated from the web site. Details follow."
.HTMLBody = .HTMLBody & "<br><br>" & upload.form("txtDescription")

'Make file upload optional.
i=1
if count > 0 Then
do while i <= count
set file = upload.Files(i)
.AddAttachment documentPath & "\" & file.fileName
i=i+1
loop
Response.Write count & " file(s) uploaded.</p>"

End if

if documentName <> "" Then
Response.Write “No files were uploaded..”
End if


.Send
End With


set iMsg = Nothing
set iConf = Nothing
set Flds = Nothing
%>

baldwingrand
04-07-2008, 06:37 PM
Looks like I figured out my own issue...

With iMsg
Set .Configuration = iConf

'Set email Importance

'Outlook 2003:
.Fields.Item("urn:schemas:mailheader:X-MSMail-Priority") = "High"
.Fields.Item("urn:schemas:mailheader:X-Priority") = 2

'Outlook Express:
.Fields.Item("urn:schemas:httpmail:importance") = 2

.Fields.Update

etc...