472,790 Members | 1,411 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,790 software developers and data experts.

Setting message priority with CDOSYS

Hello. Can someone please tell me how to set the priority of an email
message
sent from an ASP script using CDOSYS as below -

set oCdoMsg = server.createobject("CDO.Message")
oCdoMsg.from=...
oCdoMsg.to=...
oCdoMsg.subject=...
oCdoMsg.importance=1 ' fails
oCdoMsg.HTMLBody=....
oCdoMsg.send

With CDONTS I successfully used .importance but that fails with CDOSYS.
I have searched the MSDN documentation but can't find it. BTW I find the
various alternatives
confusing - CDO, CDONTS, CDOEX etc.
Thanks in advance for any help.
Peter Croft
Jul 19 '05 #1
6 8942

oCdoMsg.Fields("urn:schemas:httpmail:importance"). Value = 2;
"Peter Croft" <pe*********@textandvideo.co.uk> wrote in message
news:us**************@tk2msftngp13.phx.gbl...
Hello. Can someone please tell me how to set the priority of an email
message
sent from an ASP script using CDOSYS as below -

set oCdoMsg = server.createobject("CDO.Message")
oCdoMsg.from=...
oCdoMsg.to=...
oCdoMsg.subject=...
oCdoMsg.importance=1 ' fails
oCdoMsg.HTMLBody=....
oCdoMsg.send

With CDONTS I successfully used .importance but that fails with CDOSYS.
I have searched the MSDN documentation but can't find it. BTW I find the
various alternatives
confusing - CDO, CDONTS, CDOEX etc.
Thanks in advance for any help.
Peter Croft

Jul 19 '05 #2
That doesn't work. It doesn't raise an error but neither does it change the
priority.
The documentation (if I'm looking in the right place) says Fields is
read-only.

Thanks,
Peter
"dave" <no**@invalid.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...

oCdoMsg.Fields("urn:schemas:httpmail:importance"). Value = 2;
"Peter Croft" <pe*********@textandvideo.co.uk> wrote in message
news:us**************@tk2msftngp13.phx.gbl...
Hello. Can someone please tell me how to set the priority of an email
message
sent from an ASP script using CDOSYS as below -

set oCdoMsg = server.createobject("CDO.Message")
oCdoMsg.from=...
oCdoMsg.to=...
oCdoMsg.subject=...
oCdoMsg.importance=1 ' fails
oCdoMsg.HTMLBody=....
oCdoMsg.send

With CDONTS I successfully used .importance but that fails with CDOSYS.
I have searched the MSDN documentation but can't find it. BTW I find the
various alternatives
confusing - CDO, CDONTS, CDOEX etc.
Thanks in advance for any help.
Peter Croft


Jul 19 '05 #3
Hi Peter,

I think it should be:

oCdoMsg.Fields("urn:schemas:mailheader:priority"). Value = 1

Here is related document:

http://msdn.microsoft.com/library/de...us/wss/wss/_cd
o_schema_mailheader_priority.asp?frame=true

http://msdn.microsoft.com/library/de...us/wss/wss/_cd
o_cdopriorityvalues_enum.asp

Luke

Jul 19 '05 #4
I can't get these to work either, even when I set importance to high and
priority to urgent, the header comes in with both stating normal. I think
it might depend on the SMTP server, whether it preserves the values or
ignores them. Here is the code I used (I tried setting the imp/pri on both
config and message):

<!--
METADATA
TYPE="typelib"
UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
NAME="CDO for Windows 2000 Library"
-->
<%
Set cdoConfig = CreateObject("CDO.Configuration")

With cdoConfig.Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "<mail server>"
.Item(cdoPriority) = cdoPriorityUrgent
.Item(cdoImportance) = cdoHigh
.Update
End With

Set cdoMessage = CreateObject("CDO.Message")

With cdoMessage
Set .Configuration = cdoConfig
.Fields(cdoPriority) = cdoPriorityUrgent
.Fields(cdoImportance) = cdoHigh
.From = "fr**@from.com"
.To = "to@to.com"
.Subject = "Sample CDO Message"
.TextBody = "This is a test for CDO.message"
.Send
End With

Set cdoMessage = Nothing
Set cdoConfig = Nothing
%>

Header still says:

Importance: normal
Priority: normal

--
http://www.aspfaq.com/
(Reverse address to reply.)


"[MSFT]" <lu******@online.microsoft.com> wrote in message
news:PR**************@cpmsftngxa06.phx.gbl...
Hi Peter,

I think it should be:

oCdoMsg.Fields("urn:schemas:mailheader:priority"). Value = 1

Here is related document:

http://msdn.microsoft.com/library/de...us/wss/wss/_cd o_schema_mailheader_priority.asp?frame=true

http://msdn.microsoft.com/library/de...us/wss/wss/_cd o_cdopriorityvalues_enum.asp

Luke

Jul 19 '05 #5
"Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in
news:Oj**************@TK2MSFTNGP09.phx.gbl:
I can't get these to work either, even when I set importance to high
and priority to urgent, the header comes in with both stating normal.
I think it might depend on the SMTP server, whether it preserves the
values or ignores them. Here is the code I used (I tried setting the
imp/pri on both config and message):

<!--
METADATA
TYPE="typelib"
UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
NAME="CDO for Windows 2000 Library"
-->
<%
Set cdoConfig = CreateObject("CDO.Configuration")

With cdoConfig.Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "<mail server>"
.Item(cdoPriority) = cdoPriorityUrgent
.Item(cdoImportance) = cdoHigh
.Update
End With

Set cdoMessage = CreateObject("CDO.Message")

With cdoMessage
Set .Configuration = cdoConfig
.Fields(cdoPriority) = cdoPriorityUrgent
.Fields(cdoImportance) = cdoHigh
.From = "fr**@from.com"
.To = "to@to.com"
.Subject = "Sample CDO Message"
.TextBody = "This is a test for CDO.message"
.Send
End With

Set cdoMessage = Nothing
Set cdoConfig = Nothing
%>

Header still says:

Importance: normal
Priority: normal


You code looks fine.....

What software is the smtp server running?

--
Robert Collyer
www.webforumz.com
Free Web Design and Development Help, Discussions, tips and Critique!
ASP, VB, .NET, SQL, CSS, HTML, Javascript, Flash, XML, SEO !
Jul 19 '05 #6
Hi Ten,

I suggested you try Luke's suggestion to set periority.

Another link on this topic:
http://groups.google.com/groups?q=CD...ail&hl=en&lr=&
ie=UTF-8&selm=6gg13vcuntc5hs35fa8pnc5taqhnj2ef65%404ax.co m&rnum=1

Peter, is the problem resolved? Thanks.

Best regards,
Yanhong Huang
Microsoft Community Support

Get Secure! C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
-http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.as
p&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: | last post by:
Hi, I am loading some crystal reports in a method similar to this (see below). And set the cursor to waiting while the reoprt is loaded, run and shown. BUT while the report is running the cursor...
3
by: Steve Yerkes | last post by:
There seems to be way too much confusion over how to set focus on the a field using a field validator. I looked all over the web and found people trying to do this, but not getting anywhere. There...
8
by: David Lozzi | last post by:
Howdy, I have a user control that is a report to display data. On the page the control is inserted in, I have filter options to filter the report. When I try to do something like this, nothing...
14
by: Bernie Yaeger | last post by:
OK - I'm very close. I'm running a console app on a server and it fails with cdo .message failure. It's a simple email routine which works fine on my development pc. Do you have any idea what...
3
by: DexHex | last post by:
Hi, I am stumpt. Is there anyway to set the background image on a webpart title?
24
by: Manuel | last post by:
Is it possible to embed an image, like a company logo in a CDOSYS generated message? If yes, I´ll apreciate some code sample. I´ve been able to format messages in html the way I like, but I...
0
by: kvogelgesang | last post by:
Hi all, I have an Access 2000 Database that is programed to send out emails and is working fine except i would like to change the message priority to High so it buzzes people using blackberries...
3
by: John Nagle | last post by:
There's no way to set thread priorities within Python, is there? We have some threads that go compute-bound, and would like to reduce their priority slightly so the other operations, like...
0
by: afromanam | last post by:
Just in case anyone is interested the code should be <% Set myMail=CreateObject("CDO.Message") myMail.Subject="Sending email with CDO" myMail.From="USERNAME@SERVER.COM"...
0
by: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.