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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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/

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
abgtempAuthor Commented:
I found that same link, but I wasn't able to get that code to work with my existing code.
sirbountyCommented:
change cdoMail to objEmail in your code - make sure it's before the objEmail.Configuration.Fields.Update line...
Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

abgtempAuthor Commented:
Still nothing. Were you able to get it to work on your side?
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.

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

sirbountyCommented:
what's different from my first post?
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.
AmazingTechCommented:
I glad it worked for you abgtemp.
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! :^)
FWAdminCommented:
Missing line was:
objEmail.Fields.Update

instead of only:
objEmail.Configuration.Fields.Update

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.