Mark email as High Importance in vbscript

I need a little help with this one..... Could someone give me a little assistance in how to edit the vbscript below to send an email marked as "High Importance".  Thanks in advance.
Set objEmail = CreateObject("CDO.Message")
Set objFSO = CreateObject("Scripting.FileSystemObject") 
 
objEmail.Subject = "Test Mail" 
objEmail.From = "me@mail.com" 
objEmail.To= "you@mail.com"
objEmail.TextBody =  "This is an important email"
objEmail.Configuration.Fields.Item _ 
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 
objEmail.Configuration.Fields.Item _ 
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _ 
"smtp.east.cox.net" 
objEmail.Configuration.Fields.Item _ 
 ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 
objEmail.Configuration.Fields.Update 
objEmail.Send

Open in new window

abgtempAsked:
Who is Participating?
 
sirbountyCommented:
cdoMail.Fields.Item("urn:schemas:mailheader:X-MSMail-Priority") = "High" ' For Outlook 2003
cdoMail.Fields.Item("urn:schemas:mailheader:X-Priority") = 2 ' For Outlook 2003 also
cdoMail.Fields.Item("urn:schemas:httpmail:importance") = 2 ' For Outlook Express

ref: http://www.lewisroberts.com/2006/06/09/sending-cdomessage-with-importance/
0
 
abgtempAuthor Commented:
I found that same link, but I wasn't able to get that code to work with my existing code.
0
 
sirbountyCommented:
change cdoMail to objEmail in your code - make sure it's before the objEmail.Configuration.Fields.Update line...
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
abgtempAuthor Commented:
Still nothing. Were you able to get it to work on your side?
0
 
sirbountyCommented:
Odd - no, I haven't...tried several different methods - but I use system.mail in .Net for my projects now, so I didn't have many sample scripts to check.

http://www.activexperts.com/ActivEmail/ provides a means for accomplishing it, if you're wanting to try that instead.

0
 
AmazingTechCommented:
Try it this way.
Set objEmail = CreateObject("CDO.Message")
 
objEmail.Subject = "Test Mail" 
objEmail.From = "me@mail.com" 
objEmail.To= "you@mail.com"
objEmail.TextBody =  "This is an important email"
 
objEmail.Configuration.Fields.Item _ 
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 
objEmail.Configuration.Fields.Item _ 
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _ 
"smtp.east.cox.net" 
objEmail.Configuration.Fields.Item _ 
 ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 
objEmail.Configuration.Fields.Update 
 
objEmail.Fields.Item("urn:schemas:mailheader:X-MSMail-Priority") = "High"
objEmail.Fields.Item("urn:schemas:mailheader:X-Priority") = 2
objEmail.Fields.Item("urn:schemas:httpmail:importance") = 2
objEmail.Fields.Update
 
objEmail.Send

Open in new window

0
 
sirbountyCommented:
what's different from my first post?
0
 
abgtempAuthor Commented:
Sir Bounty, I'm not quite sure what was wrong, but I could not get your code to work. But this was this was a coding error on my part. After looking at Amazing Tech's solution, it appears that I didn't do something right. Since Sir Bounty did have this solution earlier but I was unable to code it correctly, I will give him the most points. But I do thank Amazing Tech for providing a code using my existing code. Thanks to both of you. I'm bumping up the points and splitting the points.
0
 
AmazingTechCommented:
I glad it worked for you abgtemp.
0
 
sirbountyCommented:
Probably because your cdo mail object was named objEmail and the one from the example link was cdoMail.  Presumably that wasn't changed?

Anyway - glad you got it working.  Thanx for the grade! :^)
0
 
FWAdminCommented:
Missing line was:
objEmail.Fields.Update

instead of only:
objEmail.Configuration.Fields.Update

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.