467,911 Members | 1,375 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,911 developers. It's quick & easy.

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
  • viewed: 8598
Share:
6 Replies

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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by David Lozzi | last post: by
14 posts views Thread by Bernie Yaeger | last post: by
reply views Thread by kvogelgesang | last post: by
3 posts views Thread by John Nagle | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.