Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CDO CreateMHTMLBody not picking up changes

Status
Not open for further replies.

rschaeferhig

IS-IT--Management
May 2, 2003
10
US
I'm using CDO to construct a mail message using the method:
msg.CreateMHTMLBody("URL")
where URL points to an HTML file on an IIS web server. I send the message and the content agrees with what's on the web server. I make a change to the web page, run my ASP page again to build and send a new message and I get the old content. I tried adding the Cache-Control/no-cache and Pragma/no-cache Meta tags to the web page with no luck. The only thing that seems to force the web server to serve the changed page is restarting the web server, an unacceptable tactic.

Anyone run into this and/or have any idea on how to get the IIS web server to stop caching these pages?

This app is scheduled for production on Monday so any help would be greation appreciated.
 
I find the best thing to do with troubles like that is to just refresh the virtual server that the site is hosted on.

I hope that helps, but tell me if I am wrong, so i know for future reference!



Richard Noon
 
Thanks for your quick response, but the web server is a corporate web server hosting dozens of production applications. Refreshing it on the fly isn't practical since it breaks the sessions of all connected users. Also, do I really want an end-user of a web application somehow refreshing a production server on the fly from an application web page??
 
I was able to fix this by setting the HTTP Headers in the Virtual Server to Expires Immediately. This forces the web server to serve a new copy of the page every time regardless of whether or not it thinks the page was modified.
 
rschaeferhig,

Have you set up the cdo.configuration, in particular, the fields(cdoURLGetLatestVersion) to true?
[tt]
set oconfig=server.createobject("cdo.configuration")
cdoURLGetLatestVersion="oconfig.fields(cdoURLGetLatestVersion)=true
oconfig.fields.update
[/tt]
Then with the omsg
[tt]
set omsg.configuration=oconfig
[/tt]
before sending and assigning other properties to omsg.

regards - tsuji
 
rschaeferhig,

Okay. Have not seen your update before I posted mine. Glad you get a solution and thanks for sharing.

- tsuji
 
tsuji,

Thanks for the tip. I'll give that a try with the server set back to it's normal setting to see if that works. I'd rather have a fix in the app than to modify the server.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top