Test CDO Message Send Response

J

jp2code

Does the .Send method return anything from CDOSYS?

Ex:
Dim result
Set oMail = CreateObject("CDO.Message")
' other code
result = oMail.Send

I've tried searching, but I can't find where anyone says what "Send"
returns. An integer, a boolean, a string, or void?
 
J

jp2code

Hi Mr. Jones,

Since the Send method does not return anything, is there another value I can
examine to test for success?

If the submittal is successful, I want to direct them to a thank you page,
but not if the submittal failed.
 
A

Anthony Jones

jp2code said:
Hi Mr. Jones,

Since the Send method does not return anything, is there another value I can
examine to test for success?

If the submittal is successful, I want to direct them to a thank you page,
but not if the submittal failed.

If it fails it will raise an error.

You could use:-

On Error Resume Next
oMsg.Send
If Err.Number = 0 then
'Redirect to thank you page
Else
'Respond with error info possibly using Err.description
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

asp send mail cdo error 1
CDO Message help 1
CDO doesn't send email 1
CDO message attach files 1
Send form data using CDO 3
CDO generating duplicate e-mails 0
CDOSYS send email with ASP 9
CDO message help 1

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,270
Latest member
TopCryptoTwitterChannels_

Latest Threads

Top