Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7896835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:59:45+00:00 2026-06-03T07:59:45+00:00

I have the following code: Set myMailanon = CreateObject(CDO.Message) myMailanon.MimeFormatted = True Set myConfanon

  • 0

I have the following code:

Set myMailanon = CreateObject("CDO.Message")
myMailanon.MimeFormatted = True

Set myConfanon = Server.CreateObject("CDO.Configuration")
Set objBPanon = myMailanon.AddRelatedBodyPart("http://www.foo.bar/img/logo1.jpg", "http://www.foo.bar/img/logo1.jpg", CdoReferenceTypeName)
objBPanon.Fields.Item("urn:schemas:mailheader:Content-ID") = "<http://www.foo.bar/img/logo1.jpg>" 
objBPanon.Fields.Update 
ConfURLanon = "http://schemas.microsoft.com/cdo/configuration/"

with myConfanon        
  .Fields.Item(ConfURLanon & "sendusing") = 2        
  .Fields.Item(ConfURLanon & "smtpserver") = "smtp.foo.bar"        
  .Fields.Item(ConfURLanon & "smtpserverport") = 25     
  .Fields.Item(ConfURLanon & "smtpusessl") = false
  .Fields.Item(ConfURLanon & "smtpauthenticate") = 1
  .Fields.Item(ConfURLanon & "sendusername") = "foo@bar.com"
  .Fields.Item(ConfURLanon & "sendpassword") = "foobarpass"
  .Fields.Update
end with

with myMailanon
  .Subject='Foo!! Bar!!'
  .From='Foo!! Bar!! <foo@bar.com>'      
  .To='foo@bar.com,bar@foo.com'      
  txt="This is foo... bar... text... SPARTAAAAAAAAA"
  .HTMLBody = txt
  Set .Configuration = myConfanon   
  On Error Resume Next 
  .Send      
end with

Problem is that this code, run 100 times, will work 30 and fail 70. Randomly.
And by “fail” I mean that it will cause Script execution timeout.

After commenting line by line, I got to the conclusion that the error comes from “.Send”.
But why? Any ideas?

Regards

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T07:59:46+00:00Added an answer on June 3, 2026 at 7:59 am

    There isn’t anything wrong with code (athough CdoReferenceTypeName looks a little suspect but that could be just poor variable naming). It could just be that the SMTP server is busy and is therefore taking a while to process the send.

    You could check the Script Time-out value specified for the ASP feature in IIS manager. By default it should be 90 seconds but perhaps its been set to a low value for some reason.

    You can increase the amount of time you script has by specifying it in your code.

    Server.ScriptTimeout = 300
    

    Which would give your script a 5 minutes. This may well be masking some set up problem between your web server and SMTP server but it may increase the success rate. OTH you may get the same results but the 70% failures take longer to occur.

    Whatever the cause I don’t think its your code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following tsql code in sql server 2008: declare @ID INT SET @ID
I have the following code: //set $message and run database query $message .= '<body
I have following code <asp:SqlDataSource ID=SqlDataSource1 runat=server UpdateCommand=UPDATE [gMeter] SET ... [userId] = @userId
I have the following code set up in my Startup IDictionary<string, string> properties =
I have the following code to set a userId variable: (userId set in prior
I have following code in my application: // to set tip - photo in
I have the following code: UPDATE myTable SET Col1 = @Value However, I have
I have used the following code to set cookie and then redirect. String level=(String)
I have the following code: private static final Set<String> allowedParameters; static { Set<String> tmpSet
I have the following code that seems like it should set my insertParameter but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.