Wrox Programmer Forums
|
ASP CDO As of Oct 5, 2005, this forum is now locked. No posts have been deleted. Please use "Classic ASP Professional" at: http://p2p.wrox.com/forum.asp?FORUM_ID=56 for discussions similar to the old ASP Pro Code Clinic or one of the other many remaining ASP and ASP.NET forums here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP CDO section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 15th, 2004, 07:17 PM
Registered User
 
Join Date: Mar 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Priority HIGH CDO (Importance)

I cant seem to find the code to set the priority of the message High. Ive looked every were, using win2k code is below. I cant seem to find the schema anywhere.

In some cases this code is sent from the smtp on the webserver in some cases it goes to a remote exchange server using CDOBasic. In neither case have I been able to elevate the importance.

'on error resume next
Set Mssg = Server.CreateObject("CDO.Message")
set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
    With Flds
        .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
        .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "MyWebServer"
        .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
        .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
        .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate")=0
        .Item("urn:schemas:httpmail:importance").Value = 2
        .Update
    End With

    with Mssg
    Set .Configuration = iConf
        .CreateMHTMLBody ("http://www.SomeWebsite.com/")
        .Subject = "Test Of Web Mail"
        .From = "[email protected]"
        .To = "[email protected]"
        .Send
    End With

Set Mssg=Nothing
Set iConf=Nothing
Set Flds=Nothing

 
Old April 26th, 2004, 12:27 PM
Registered User
 
Join Date: Aug 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

OK I got it. What you have there is correct. But we need to add a few more things. You can get all this info from the following sources:

http://msdn.microsoft.com/library/de...figuration.asp

http://msdn.microsoft.com/library/de...alues_enum.asp

http://msdn.microsoft.com/library/de...es_message.asp

So what we have is this:

With iMsg
   Set .Configuration = iConf
   .To = strTo
   .From = strFrom
   .ReplyTo = strFrom
   .Subject = strSubject ' "This is a test CDOSYS message (Sent via Pickup)"
   .HTMLBody = strHTML
   Set Flds = .Fields
   With Flds
      If lngImportance = 0 Then
         .Item("urn:schemas:mailheader:X-Priority") = 5
      ElseIf lngImportance = 1 Then
         .Item("urn:schemas:mailheader:X-Priority") = 3
      Else
         .Item("urn:schemas:mailheader:X-Priority") = 0
      End If
      .Item("urn:schemas:httpmail:importance") = lngImportance
      .Item("urn:schemas:mailheader:X-MSMail-Priority") = lngImportance
      .Update
   End With
   '.Fields("urn:schemas:httpmail:importance").Value = lngImportance
   '.Fields.Update
   'TODO: if adding an attachment,
   'uncomment the next line and alter file path as required
   'Set iBP = iMsg.AddAttachment(App.Path & "\file1.txt")
   .Send
End With

Now note if the message is received in Hotmail you will not see the Impotance flag. You haver to open the message or save to your drive. If you open the message it will have the priority you expect.

Any issues let me know.
 
Old January 20th, 2005, 05:16 PM
AZ AZ is offline
Registered User
 
Join Date: Jan 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks hesterloli.








Similar Threads
Thread Thread Starter Forum Replies Last Post
Importance of SSL Certificates trents4life ASP.NET 2.0 Basics 0 November 24th, 2006 09:17 AM
capturing high priority events of windows rinks Pro VB 6 0 March 16th, 2005 04:57 AM
Importance of Robot file eapsokha HTML Code Clinic 1 August 30th, 2004 05:14 AM
Importance in CDO patwadd Classic ASP Databases 2 August 15th, 2004 05:54 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.