473,385 Members | 1,492 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

ASP / CDOSYS - Performance issue

I'm hosted on a shared server with Godaddy.com... I have several forms on my website that all use the same ASP file to send out my forms..
It worked fine for a long time, but now the forms send to my e-mail arrive after a few hours instead of instantly.
Calling Godaddy did not help as they stated all is working fine (no delays) on their end and refuse to help with custom scripts..

My emails are also hosted by godaddy like my website.

Hopefully someone here can have a look at my code and see why I might have such huge delays?
Note:
The delays seem to happen when using CDOSYS... I'm also setting up a shopping cart (ProductCart) and when using the CDOSYS function for their email script it has also a huge delay, while setting it to CDO it arrives within minutes...
I do not get any errors, all seems to go fine and mail does arrive after a few hours.

Here's the code (personal info marked out of cos):

Expand|Select|Wrap|Line Numbers
  1. <%
  2. option explicit
  3. dim pde : set pde = createobject("scripting.dictionary")
  4.  
  5. pde.add "%mailing%", "email1@myserver.com"
  6. pde.add "%webmaster%", "email2@myserver.com"
  7. pde.add "%info%", "email3@myserver.com"
  8. pde.add "%email%", "email4@myserver.com"
  9.  
  10. function getTextFromFile(path)
  11. dim fso, f, txt
  12. set fso = createobject("Scripting.FileSystemObject")
  13. if not fso.fileexists(path) then
  14. getTextFromFile = ""
  15. exit function
  16. end if
  17. set f = fso.opentextfile(path,1)
  18. if f.atendofstream then txt = "" else txt = f.readall
  19. f.close
  20. set f = nothing
  21. set fso = nothing
  22. getTextFromFile = txt
  23. end function
  24.  
  25. dim redir, mailto, email, subject, item, body, cc, bcc, message, html, template, usetemplate, testmode
  26. redir = request.form("redirect")
  27. mailto = request.form("mailto")
  28. if pde.exists(mailto) then mailto = pde(mailto)
  29. cc = request.form("cc")
  30. bcc = request.form("bcc")
  31. email = request.form("email")
  32. if email = "" then email = pde("%email%")
  33. subject = request.form("subject")
  34. message = request.form("message")
  35. template = request.form("template")
  36. testmode = lcase(request.form("testmode"))="no"
  37.  
  38. if len(template) > 0 then template = getTextFromFile(server.mappath(template))
  39. if len(template) > 0 then usetemplate = true else usetemplate = false
  40. dim msg : set msg = server.createobject("CDO.Message")
  41. msg.subject = subject
  42. msg.to = mailto
  43. msg.from = email
  44. if len(cc) > 0 then msg.cc = cc
  45. if len(bcc) > 0 then msg.bcc = bcc
  46.  
  47. if not usetemplate then
  48. body = body & message & vbcrlf & vbcrlf
  49. else
  50. body = template
  51. end if
  52. for each item in request.form
  53. select case item
  54. case "redirect", "mailto", "cc", "bcc", "subject", "message", "template", "html", "testmode"
  55. case else
  56. if not usetemplate then
  57. if item <> "email" then body = body & item & ": " & request.form(item) & vbcrlf & vbcrlf
  58. else
  59. body = replace(body, "[$" & item & "$]", replace(request.form(item),vbcrlf,"<br>"))
  60. end if
  61. end select
  62. next
  63.  
  64. if usetemplate then 'remove any leftover placeholders
  65. dim rx : set rx = new regexp
  66. rx.pattern = "\[\$.*\$\]"
  67. rx.global = true
  68. body = rx.replace(body, "")
  69. end if
  70.  
  71. if usetemplate and lcase(request.form("html")) = "yes" then
  72. msg.htmlbody = body
  73. else
  74. msg.textbody = body
  75. end if
  76. if testmode then
  77. if lcase(request.form("html")) = "yes" then
  78. response.write "<pre>" & vbcrlf
  79. response.write "Mail to: " & mailto & vbcrlf
  80. response.write "Mail from: " & email & vbcrlf
  81. if len(cc) > 0 then response.write "Cc: " & cc & vbcrlf
  82. if len(bcc) > 0 then response.write "Bcc: " & bcc & vbcrlf
  83. response.write "Subject: " & subject & vbcrlf & string(80,"-") & "</pre>"
  84. response.write body
  85. else
  86. response.write "<html><head><title>Sendmail.asp Test Mode</title></head><body><pre>" & vbcrlf
  87. response.write "Mail to: " & mailto & vbcrlf
  88. response.write "Mail from: " & email & vbcrlf
  89. if len(cc) > 0 then response.write "Cc: " & cc & vbcrlf
  90. if len(bcc) > 0 then response.write "Bcc: " & bcc & vbcrlf
  91. response.write "Subject: " & subject & vbcrlf & vbcrlf
  92. response.write string(80,"-") & vbcrlf & vbcrlf & "<span style=""color:blue;"">"
  93. response.write body & "</span>" & vbcrlf & vbcrlf
  94. response.write string(80,"-") & vbcrlf & "**END OF EMAIL**</pre></body></html>"
  95. end if
  96. else
  97. msg.send
  98. response.redirect redir
  99. end if
  100. set msg = nothing
  101. %>
I also tried adding these lines (and combinations) without any better results:

Expand|Select|Wrap|Line Numbers
  1. msg.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
  2. msg.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "relay-hosting.secureserver.net"
  3. msg.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 3535
  4. msg.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") =1
  5. msg.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "email1@myserver.com"
  6. msg.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "abc1234"
Here's a sample of what's used in the forms:

Expand|Select|Wrap|Line Numbers
  1. <form action="/sendmail_cdo.asp" method="post" name="SampleForm" id="SampleForm">
  2. <input type="hidden" name="redirect" value="http://www.myserver.com/thanks.htm">
  3. <input name="mailto" type="hidden" id="mailto" value="%webmaster%">
  4. <input name="subject" type="hidden" id="subject" value="Website Form Submission: Sample form from website">
In the html template used with the form, I use [$form_fieldname$] to display the values entered in the forms.


Anyone any ideas why there might be this huge delay and/or does anyone know how to change this to CDO instead of CDOSYS (as this worked for the shopping cart)?
May 1 '08 #1
1 1361
jhardman
3,406 Expert 2GB
Anyone any ideas why there might be this huge delay and/or does anyone know how to change this to CDO instead of CDOSYS (as this worked for the shopping cart)?
CDO is the same as CDOSYS, In the code it is just CDO, so some people call it CDO, but the official name is CDOSYS. (Unless you mean CDONTS in which case this is different and you shouldn't use CDONTS any more.) So I guess I'm saying I don't understand the question.

Jared
May 5 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Paul Mateer | last post by:
Hi, I have been running some queries against a table in a my database and have noted an odd (at least it seems odd to me) performance issue. The table has approximately 5 million rows and...
0
by: Mortisus | last post by:
Hi, I'm running a fulltext query on a ~50000 record mysql database and while performance is usually satisfying - about 0.02 secs per query, i get a critical performance deterioration when looking...
1
by: bob | last post by:
Currently i'm writing some low level communication modules in C++ and is thinking of putting it into a library so that it can be used in C#. My concern is the performance issue when putting C++...
17
by: 57R4N63R | last post by:
I'm currently building a website for one of the client. There has been few errors here and there, but just recently the problem is getting worse. Basically the symptoms is that when the user try...
16
by: D. Stimits | last post by:
A non-profit organization is interested in a new data application that would use a SQL storage system. I'm interested to know how non-profit companies that are not selling products are considered...
5
by: Varangian | last post by:
Hi, I have a performance issue question? which is best (in terms of efficiency and performance, I don't care neatness in code)... building an ArrayList of Object Instances using SqlDataReader...
10
by: shsandeep | last post by:
The ETL application loaded around 3000 rows in 14 seconds in a Development database while it took 2 hours to load in a UAT database. UAT db is partitioned. Dev db is not partitioned. the...
0
by: Shades799 | last post by:
Hi All, I was wondering if any of you could help me with a very difficult problem that I am having. I have an ASP site that works with an Oracle database using an ADODB connection. This...
7
by: Andres Rormoser | last post by:
I'm having a performance Issue with my Production SQL Server (2 x Xeon Dual-Core Woodcrest 1.6Ghz, 2GB RAM, IIS, SQL Server). In general the querys take much longer than the querys in my...
8
by: worldofrugs | last post by:
I'm hosted on a shared server with Godaddy.com... I have several forms on my website that all use the same ASP file to send out my forms.. It worked fine for a long time, but now the forms send to...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.