Link to home
Start Free TrialLog in
Avatar of abgtemp
abgtempFlag for United States of America

asked on

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

ASKER CERTIFIED SOLUTION
Avatar of sirbounty
sirbounty
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of abgtemp

ASKER

I found that same link, but I wasn't able to get that code to work with my existing code.
change cdoMail to objEmail in your code - make sure it's before the objEmail.Configuration.Fields.Update line...
Avatar of abgtemp

ASKER

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

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
what's different from my first post?
Avatar of abgtemp

ASKER

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.
Avatar of AmazingTech
AmazingTech

I glad it worked for you abgtemp.
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! :^)
Missing line was:
objEmail.Fields.Update

instead of only:
objEmail.Configuration.Fields.Update