472,338 Members | 1,814 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

CDO + Cookies

I found that a number of my sites that send email using CDO failed
withing the past 30 days. Consider the following. I know its not the
best coding practice to open and close the connection so many times but
Im curious why this would all of a sudden become an issue.

1. Have a few large sites essentially all variables such as SMTP server
are set using cookies so I can deploy multiple sites quickly.

2. Within the site email appears to work correctly across all pages
with 1 exception.

3. The exception is below, Im wondering if it has to do with cookies
having to be retrieved multiple times from the client machine

--Call db run search loop data build array
--Based on data in array call another search alter and finalize array
--Do while <= uBound(myArray)
--Call Email sub (from,to,sub,body) ' Sub contains a request
cookies for SMTP server.
--Loop

Doesnt matter if its 2 or 50 emails always fails when using
request.cookies to set the SMTP in the sub. Works fine if I hard code
the IP. This same sub is used multiple times throughout the website and
works fine with cookies.

Just curious why it needs might need to be hard coded in the loop. Has
been running for about 6 months fine and have recently started noticing
failures.

Thanks,
Earl

Jun 12 '06 #1
4 1581

surf_doggie wrote:
I found that a number of my sites that send email using CDO failed
withing the past 30 days. Consider the following. I know its not the
best coding practice to open and close the connection so many times but
Im curious why this would all of a sudden become an issue.

1. Have a few large sites essentially all variables such as SMTP server
are set using cookies so I can deploy multiple sites quickly.

2. Within the site email appears to work correctly across all pages
with 1 exception.

3. The exception is below, Im wondering if it has to do with cookies
having to be retrieved multiple times from the client machine

--Call db run search loop data build array
--Based on data in array call another search alter and finalize array
--Do while <= uBound(myArray)
--Call Email sub (from,to,sub,body) ' Sub contains a request
cookies for SMTP server.
--Loop

Doesnt matter if its 2 or 50 emails always fails when using
request.cookies to set the SMTP in the sub. Works fine if I hard code
the IP. This same sub is used multiple times throughout the website and
works fine with cookies.
I'm confused - it either works with cookies or it doesn't.

Just curious why it needs might need to be hard coded in the loop. Has
been running for about 6 months fine and have recently started noticing
failures.


You should never rely on storing info like this in cookies. People
delete them, and your application depends on them. Application level
information should be stored on the server - application
variables/db/xml/etc...

Have you checked to see if the cookie exists?

--
Mike Brind

Jun 13 '06 #2
> I'm confused - it either works with cookies or it doesn't.

Just curious why it needs might need to be hard coded in the loop. Has
been running for about 6 months fine and have recently started noticing
failures.


You should never rely on storing info like this in cookies. People
delete them, and your application depends on them. Application level
information should be stored on the server - application
variables/db/xml/etc...

Have you checked to see if the cookie exists?

--
Mike Brind


Hey Mike Ive seen your posts I respect your opinion. Please let me
clarify.

1. I agree either it works or it doesnt. Thats why I dont understand.
2. I only store the cookies on the client machine for the session when
they close their browser the cookies are gone. These are not
application level cookies just plain jane.

consider this I have 100 webpages.
<!-- some include file with cookies that expire when you close browser
(mailhost included)>
-->You have successfully logged in mailhost cookie is set.

On about 50 of those pages if you want to send and individual
email it calls
--call SendMail(efrom,eto,subject,body)

Works great for an email or 2.

This may be where the rub is at Mike.

Now every night I had scheduled a bat file to run and send multiple
emails from a db. Failed mail couldnt be sent. At first I thought it
was the permissions on the bat file or the permissions the AT Scheduler
from windows was using but when I went to the url from my browser it
died with smtp errors.

I did trouble shooting for a month. When I hard coded the url it
worked... O YES the connection for the cookies was in the loop file
because I did a response.write to make sure the smtp server was correct
in the loop file before I hard coded the IP of the SMTP server.

Now Im just curious I have the solution, I agree either it works or it
doesnt but why does it work sometimes? Is it because the loop cant grab
the request.cookies off the client machine fast enough to keep up with
what the CDO needs for the SMTP server config?

These sites had been working up until about 1 to 3 months ago for a
year and started cascade failing on the CDO. Once I figured to hard
code the IP instead of cookies alls well.

Thanks for your time.
Earl

Jun 17 '06 #3
Sorry forgot to point out all of the emails are based off of the same
function
surf_doggie wrote:
I'm confused - it either works with cookies or it doesn't.

Just curious why it needs might need to be hard coded in the loop. Has
been running for about 6 months fine and have recently started noticing
failures.


You should never rely on storing info like this in cookies. People
delete them, and your application depends on them. Application level
information should be stored on the server - application
variables/db/xml/etc...

Have you checked to see if the cookie exists?

--
Mike Brind


Hey Mike Ive seen your posts I respect your opinion. Please let me
clarify.

1. I agree either it works or it doesnt. Thats why I dont understand.
2. I only store the cookies on the client machine for the session when
they close their browser the cookies are gone. These are not
application level cookies just plain jane.

consider this I have 100 webpages.
<!-- some include file with cookies that expire when you close browser
(mailhost included)>
-->You have successfully logged in mailhost cookie is set.

On about 50 of those pages if you want to send and individual
email it calls
--call SendMail(efrom,eto,subject,body)

Works great for an email or 2.

This may be where the rub is at Mike.

Now every night I had scheduled a bat file to run and send multiple
emails from a db. Failed mail couldnt be sent. At first I thought it
was the permissions on the bat file or the permissions the AT Scheduler
from windows was using but when I went to the url from my browser it
died with smtp errors.

I did trouble shooting for a month. When I hard coded the url it
worked... O YES the connection for the cookies was in the loop file
because I did a response.write to make sure the smtp server was correct
in the loop file before I hard coded the IP of the SMTP server.

Now Im just curious I have the solution, I agree either it works or it
doesnt but why does it work sometimes? Is it because the loop cant grab
the request.cookies off the client machine fast enough to keep up with
what the CDO needs for the SMTP server config?

These sites had been working up until about 1 to 3 months ago for a
year and started cascade failing on the CDO. Once I figured to hard
code the IP instead of cookies alls well.

Thanks for your time.
Earl


Jun 17 '06 #4
Sorry would also like to point out its on multiple web servers in
multiple networks.

Mike if you want to see a demo Ill set up a webex

Earl
surf_doggie wrote:
I'm confused - it either works with cookies or it doesn't.

Just curious why it needs might need to be hard coded in the loop. Has
been running for about 6 months fine and have recently started noticing
failures.


You should never rely on storing info like this in cookies. People
delete them, and your application depends on them. Application level
information should be stored on the server - application
variables/db/xml/etc...

Have you checked to see if the cookie exists?

--
Mike Brind


Hey Mike Ive seen your posts I respect your opinion. Please let me
clarify.

1. I agree either it works or it doesnt. Thats why I dont understand.
2. I only store the cookies on the client machine for the session when
they close their browser the cookies are gone. These are not
application level cookies just plain jane.

consider this I have 100 webpages.
<!-- some include file with cookies that expire when you close browser
(mailhost included)>
-->You have successfully logged in mailhost cookie is set.

On about 50 of those pages if you want to send and individual
email it calls
--call SendMail(efrom,eto,subject,body)

Works great for an email or 2.

This may be where the rub is at Mike.

Now every night I had scheduled a bat file to run and send multiple
emails from a db. Failed mail couldnt be sent. At first I thought it
was the permissions on the bat file or the permissions the AT Scheduler
from windows was using but when I went to the url from my browser it
died with smtp errors.

I did trouble shooting for a month. When I hard coded the url it
worked... O YES the connection for the cookies was in the loop file
because I did a response.write to make sure the smtp server was correct
in the loop file before I hard coded the IP of the SMTP server.

Now Im just curious I have the solution, I agree either it works or it
doesnt but why does it work sometimes? Is it because the loop cant grab
the request.cookies off the client machine fast enough to keep up with
what the CDO needs for the SMTP server config?

These sites had been working up until about 1 to 3 months ago for a
year and started cascade failing on the CDO. Once I figured to hard
code the IP instead of cookies alls well.

Thanks for your time.
Earl


Jun 17 '06 #5

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

Similar topics

4
by: Brian Burgess | last post by:
Hi all, Anyone know of any special issues with storing cookies with ASP? I'm trying this with two browsers: One is IE 6.0 with cookies set to...
20
by: Brian Burgess | last post by:
Hi all, Anyone know if this is possible? If so, on which page would the cookie be? .. On the page calling a function defined in the include...
9
by: | last post by:
Is it possible for a user to enable permanent cookies but disable session cookies.....this seems like a contradition yet this is what I appear to be...
1
by: John Taylor-Johnston | last post by:
I'm a University academic looking for a proper definition of JavaScript Cookies. ...
6
by: Mark | last post by:
Hi... I've come across some weird bug with Response.Cookies. Or maybe it will be called "by design" but for the life of me I can't figure out...
8
by: CDARS | last post by:
Hi all, I have a confusing question on ASP.NET cookies usage: 1> Response.Cookies("test").value = Now...
6
by: Stephane | last post by:
Hi, I have a login page where if the user wants his access codes to be saved are set into a cookie. In the logout page, I want to delete those...
1
by: Alex Nitulescu | last post by:
I have the following very simple colde (while learning about cookies and session state): Private Sub cmdAddCookie_Click(ByVal sender As...
0
by: Claudio | last post by:
I have a demo app where cookies does not work. The first page create a cookies. The second read the contet. If I browse the pages via IE6.0 the...
0
by: rn5a | last post by:
This is how I am creating & then reading cookies: <script runat="server"> Sub Page_Load(ByVal obj As Object, ByVal ea As EventArgs) 'create...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...

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.