473,804 Members | 3,750 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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,bo dy) ' 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 1647

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,bo dy) ' 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,bod y)

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,bod y)

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,bod y)

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
3887
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 'prompt'. This has been working properly as any new site I goto seems to prompt me to store their cookie. The other is Pocket IE on Pocket PC 2002, with the cookies set to 'enabled'. My problem is that the cookies dont seem to be being written with my ASP. I dont get the prompt to store...
20
3562
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 file? thanks in advance.. -BB
9
2540
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 reading in online articles?
1
3183
by: John Taylor-Johnston | last post by:
I'm a University academic looking for a proper definition of JavaScript Cookies. http://www.CollegeSherbrooke.qc.ca/languesmodernes/604-HAE_Grammar_Practice/ I'm trying to decipher what categor(ies) JavaScript cookies fall under, according to Internet Explorer's help.cfm. What I don't understand is where do JavaScript cookies fall under the help.cfm definition. Maybe I'm not reading "their" English properly? (See below.) "Persistent -...
6
3062
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 what purpose it would serve. If you're setting a cookie (say Response.Cookies ("TEST")) and you have a query string variable &test=x or &Test=x and you get Request.QueryString to parse the query string, the cookie that gets dropped matches the case of the query string, not what your code says. ...
8
2345
by: CDARS | last post by:
Hi all, I have a confusing question on ASP.NET cookies usage: 1> Response.Cookies("test").value = Now 2> Response.Write(Request.Cookies("test").value) 3> 4> Response.write("<hr>") 5> 6> Response.Cookies("test").value = Now.AddDays(10)
6
8854
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 cookies. I tried this and this is not working at all: if (Request.Cookies != null && Request.Cookies != null) { Response.Cookies.Value = null;
1
11457
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 System.Object, ByVal e As System.EventArgs) Handles cmdAddCookie.Click Dim strCookieName As String Dim objRandom As New Random() strCookieName = "MyCookie" & objRandom.Next(Integer.MaxValue).ToString
0
1712
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 pages does not work. If I browse the pages via FireFox the pages work fine. ************ SetCookies.asp <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
0
1607
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 cookies Response.Cookies("UserName").Value = "Ron" Response.Cookies("UserName").Expires = "12/31/2008" Response.Cookies("UserDetails")("FirstName") = "Ronnie" Response.Cookies("UserDetails")("LastName") = "Nathan"
0
9584
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10337
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10323
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9160
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6854
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5654
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4301
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2995
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.