Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

cdo.Message and ASP

0 views
Skip to first unread message

Moy

unread,
Oct 16, 2008, 6:11:00 PM10/16/08
to
Hello, I have a problem. I have a site in my intranet it handles Server
Extension 2002, is a Windows Server 2003. The site is developed in ASP. We
have a format that is filled or modified for the users through of the Web,
each modification when is saved, they are saved in the database and sent a
copy to the users through the object CDO.Message. At the first We had the
problem with the sending, as the same site didn´t accept anonymous access and
domain credentials, and when
you run the object CDO.Message, marked denied access, if we configured for
anonymous access the site didn’t take their credentials for show them your
information. Therefore following the Microsoft’s documentation, we create a
virtual site (with access to the same information, but for the port 8080),
this for to call the URL from the port 8080 with the object CDO.Message.

Up here all went well, when now we have a problem that we haven’t seen. When
a user change the information of the page and gives in to save, the
information is saved in the database, the object CDO.Message is executed and
the page is sent to user’s mail. However, that only works well the first
time. The second user change, and when he save the information, it has saved
save in the database and sent it to mail, but the mail arrive with the
information of the first user,it looks like anyone has changed the
information. But to come directly to the
URL, if is the information ambended.

For conclude, the problem is in the sending, than don’t take the information
updated…

I hope than you can me to help.

My code is the next one:

Set obMail = Server.CreateObject("CDO.Message")

With obMail
.To = myMail_To
.Cc = myMail_Cc
.Bcc = myMail_Bcc
.From = myMail_From
.Subject=myMail_Subject

if mid(myMail_Body,1,7) =
"http://" then
.CreateMHTMLBody
myMail_Body
else
.HtmlBody=myMail_Body

end if

.Send
End With
Set obMail = Nothing

Thanks for your help

Anthony Jones

unread,
Oct 17, 2008, 5:28:55 AM10/17/08
to

"Moy" <M...@discussions.microsoft.com> wrote in message
news:674A1557-FEDA-47B9...@microsoft.com...

The problem is likely that the response to the first request made by
CreateMHTMLBody has been cached and is used to satisify the second request.
In this case I would suggest adding some random querystring value to the url
being passed to CreateMHTMLBody.

Note that whilst CreateMHTMLBody works in this case it is not recommended
for use in ASP. The underlying API it uses to make the request is WinINET
which is heavy and does not have the thread-safety needed to multi-threaded
server side usage. You can probably get away with it in light usage but if
usage gets heavy you may start to get problems.

--
Anthony Jones - MVP ASP/ASP.NET

Moy

unread,
Oct 20, 2008, 2:05:00 PM10/20/08
to
Do you know why the same code was working on Windows 2000?

Because we changed our server, it was Windows 2000 and now is 2003, but we
didn't change any code....

Thank you.

Moy

unread,
Nov 5, 2008, 1:33:01 PM11/5/08
to
Thanks Anthony, your suggestion help me to solve my problem.

I add a random value in the URL. Now every time that the page has a update
and send it by e-mail, it really send the real information.

Thanks again.

0 new messages