473,379 Members | 1,216 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,379 software developers and data experts.

CreateMHTMLBody timeout

The code below works fine on the Win 2K, however, when I run it on the Win 2008 it gives timeout on the
.CreateMHTMLBody "http://www.something.com"
The rest of the classic asp codes work fine on Win 2008, except this one. It there any additional setting that has to be set on IIS that I'm missing?

Expand|Select|Wrap|Line Numbers
  1. <%''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  2. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  3. 'list of email addresses (separated by coma) is in the strTo 
  4.  
  5. Function SendEmail(strFrom, strSubject, strBody, strTo) 
  6.  
  7.     'set email settings        
  8.     Const cdoSendUsingPort          = 2
  9.     Const cdoBasic                  = 1
  10.  
  11.     Dim objConfig  ' As CDO.Configuration
  12.     Dim objMessage ' As CDO.Message
  13.     Dim Fields     ' As ADODB.Fields
  14.  
  15.     ' Get a handle on the config object and it's fields
  16.     Set objConfig = Server.CreateObject("CDO.Configuration")
  17.     Set Fields = objConfig.Fields
  18.  
  19.     ' Set config fields we care about
  20.     With Fields
  21.         .Item(cdoSendUsingMethod)       = cdoSendUsingPort
  22.         .Item(cdoSMTPServer)            = "************"
  23.         .Item(cdoSMTPServerPort)        = 587
  24.         .Item(cdoSMTPConnectionTimeout) = 10
  25.         .Item(cdoSMTPAuthenticate)      = cdoBasic
  26.         .Item(cdoSendUserName)          = "************"
  27.         .Item(cdoSendPassword)          = "*******"
  28.         .Update
  29.     End With
  30.  
  31.     Set objMessage = Server.CreateObject("CDO.Message")
  32.     Set objMessage.Configuration = objConfig
  33.  
  34.     With objMessage
  35.         .From     = strFrom
  36.         .Subject  = strSubject
  37.  
  38.         'set html or text body of the email
  39.         if lcase(left(strBody,4)) = "http" then
  40.                .CreateMHTMLBody strBody
  41.         else
  42.             .TextBody = strBody
  43.         end if
  44.  
  45.            EmailList = split(strTo, ",")
  46.         for intCount = 0 to uBound(EmailList) 
  47.             .To = EmailList(intCount)
  48.             .Send
  49.         next
  50.     End With
  51.  
  52.     Set Fields = Nothing
  53.     Set objMessage = Nothing
  54.     Set objConfig = Nothing
  55.  
  56.     SendEmail = "TRUE"
  57.  
  58. End Function 
  59.  
  60.  
  61. %>
Jun 24 '10 #1
9 4340
jhardman
3,406 Expert 2GB
I find sending mail with asp to be very bothersome, I avoid where possible. I have gotten timeouts in the past when there were more than two or three recipients, and when emails were being blocked. So first off, check if it still times out with very small messages / only one email address.

Jared
Jun 29 '10 #2
Timeout is not when message is sent (read the post above).
Timeout is when HTML page is loaded into HTMLBody.

I have no trouble sending text messages.
I have no trouble sending HTML messages that are created by asp (not loaded from web).
I have no problem sending big messages.
I have no problem sending bulk of messages.

As I mentioned, the problem is when I attempt to load web page. And this problem is on our new server Win 2008. The old server with Win 2k executes all codes perfectly.
Jun 29 '10 #3
jhardman
3,406 Expert 2GB
It sounds to me like it's not a problem with windows2008 per se, but a permissions or security setting that prevents you from loading the outside file. Do you have "on error resume next" in place? Sometimes this will mask the real problem and only give you a timeout error.

Jared
Jun 30 '10 #4
@jhardman
It could be as you said "security setting that prevents from loading the outside file" at least it looks like that.

I tried vb.ten by using system.web.mail and system.net.mail classes and have run into the same problem on the similar line of code when I attempted to download an online file - Timeout error message.

If this is a security setting where would you recommend checking it? I tried do the same by turning off firewall - did not helped.
Jul 1 '10 #5
@viktorka
I think I found the source of a problem. Yet, not sure how to fix it.

The difference between first server (where CreateMHTMLBody works) and second server (where CreateMHTMLBody does not works)is that on the first one each of website (26 in total) has a unique IP address and on the second one all websites are on the same IP - IIS binding is based on the Host Names. It looks like when CreateMHTMLBody is trying to access a website by it's domain name and this website is on the same server but does not have a unique IP - it times out. It works only when I place a page that CreateMHTMLBody tries to access on the main web site (binding is not based on the host name). In summary I may use CreateMHTMLBody to send pages from only on one of 26 our websites on that server.
Jul 3 '10 #6
jhardman
3,406 Expert 2GB
I've asked some IIS experts to weigh in, you got me stumped. Your reasoning sounds solid though.

Jared
Jul 6 '10 #7
Denburt
1,356 Expert 1GB
@viktorka
I would suggest you verify the following then let us know if it helps to resolve the issue or not.

I have quoted the following Note from the following link (hope this helps).
http://technet.microsoft.com/en-us/l...8WS.10%29.aspx

"After you configure a host header or multiple host headers for an IP address, you must register the host headers with the appropriate name resolution system. If your computer is on an intranet, register the host header name or names with the intranet's name resolution system. If your computer is on the Internet, register the host header name or names with the Domain Name System (DNS), which is administered by InterNic."
Jul 9 '10 #8
I do not have DNS set at all.
IIS binding works pretty fine with all websites I have.
I'm not sure if I should install DNS. I can solve my problem by moving all mail files into the main website.
Unless there could be other issues that I'm not aware off caused by absence of DNS
Jul 10 '10 #9
Denburt
1,356 Expert 1GB
@viktorka
Yes so many variables and possibilities as to how things are set up and can be set up it can be really hard to find a solution to an issue like this on a forum.

I don't mind trying though...

1. I was wondering if the page you are trying to send might be an asp page such as default.aspx or index.aspx? I have seen issues there before.

2. Have you tried sending it as a file verses using the HTTP: syntax? file://somefolder/test.htm You might even try removing the word file and send it as: //somefolder/test.htm

3. What kind of authentication are you using on your server? The following article may help you determine if it is security related and has many links to help you with any security related issues.
http://support.microsoft.com/kb/280383/

Well that's what I have for now let us know if this helps or if you have any further questions or remarks then we can go from there.
Jul 12 '10 #10

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

Similar topics

1
by: Tom_Nolan | last post by:
I am having some trouble with the ASP Script that I have written. It will e-mail me Internet pages and HTML Code just fine, but when I try to have it send an Intranet page, (which is in the same...
4
by: Braky Wacky | last post by:
Here's my scenario. I have an ASP page that I call on my server, say: http://myserver.com/firstPage.asp In this first ASP page, I want to send a MIME email that has the contents of another...
0
by: Rex | last post by:
Hello... I have a C# app, and am trying to save a web page as a .mht file using CreateMHTMLBody. It was working a while back, but now I am getting "interface not registered" errors when calling...
0
by: null_port | last post by:
Regarding Peter Bromberg's article on saving web pages as mht's using CDO: http://www.eggheadcafe.com/articles/20040527.asp I've been having fits when calling his sample code:...
0
by: SamNET | last post by:
I have a consistent Problem using CreateMHTMLBod Code works fine in development computer. When published to web it fails consitently at the line ...
4
by: DavidS | last post by:
First: There are several ways to confuse one regarding session timeout. (1) web.config - <sessionState timeout="20"> (2) IIS Manager | Internet Information Services | ServerNode | Default Web Site...
2
by: rschaeferhig | last post by:
I'm writing a .Net 1.1 app that needs to send emails with the body being formed by a locally served web page. Easy to do in legacy ASP. I found that apparently CreateMHTMLBody is not supported via...
2
by: Richard Schaefer | last post by:
I have a .Net web app (VB) that is creating CDO messages. We save a bunch of content from various sources as a web page on our web server. We then build a CDO message and use CreateMHTMLBody to...
0
by: Richard Schaefer | last post by:
I have a .Net web app (VB) that is creating CDO messages. We save a bunch of content from various sources as a web page on our web server. We then build a CDO message and use CreateMHTMLBody to...
1
by: liorhm | last post by:
Hi everyone, I'm using CDOSYS to send an HTML file to my mailing list (about 800 users), with the following syntax: myMail.CreateMHTMLBody "http://www.xxx.zzz/hello.html" It works fine when...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: 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.