Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CDONTS error

Status
Not open for further replies.

multiplex77

Programmer
Dec 25, 2001
302
0
0
SG

I'm using CDONTS to send out email from my ASP app:

Dim objMail, rsMail, result
Set objMail = CreateObject("CDONTS.NewMail")
objMail.From = FromEmail 'variable set earlier in code
objMail.To = ToEmail
objMail.Cc = CcEmail
objMail.Subject = Subject
objMail.Body = Msg
objMail.Send

One of my clients (where I installed the code) keeps getting an error at the "objMail.Send" line (no error message, though), which I can't figure out. Some points to note:

1. I can't replicate the error on my server, neither does it happen to any of my other clients.

2. I have another simple test page called sendmail.asp doing something like this:

Dim objMail, rsMail, result
Set objMail = CreateObject("CDONTS.NewMail")
objMail.From = Request.Form("From")
objMail.To = Request.Form("To")
objMail.Cc = Request.Form("Cc")
objMail.Subject = Request.Form("Subject")
objMail.Body = Request.Form("Msg")
objMail.Send

This one has no problems, even with this client.

3. All machines (mine, my clients) are using W2K Server or Pro.

Question: What could be the reason for this error? Under what conditions does CDONTS error out? I've tried blank fields and they all stil don't cause an error.

Please help. Thanks much!
 
You say the code listed in #2 DOES work on the client in question? It's the exact same lines as #1 except the way the values for the properties are set. So, I think basic troubleshooting says it MUST be a problem with one or more of the values in those variables. Perhaps one is an array instead of a single value? Or some other object by mistake? None of your variable names appear to be reserved words. (Those mistakes can get me for hours sometimes if coding in plain text! Thank God for syntax highlighting in editors.)
 
Okay, now my client says BOTH don't work. I changed to use CDOSYS and it still gives errors intermittently (it'll work once, and not work the next 3 times).

Is this anything to do with the fact that my client has not updated their patches for W2K server for sometime? I need to try and work around that because they are not able to do any Windows updates (it's too long to explain why).

Thanks for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top