Test CDO Message Send Response

Test CDO Message Send Response

am 14.09.2007 16:39:57 von 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?

Re: Test CDO Message Send Response

am 14.09.2007 17:34:22 von Anthony Jones

"jp2code" wrote in message
news:%23nbBh0t9HHA.1484@TK2MSFTNGP06.phx.gbl...
> 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?
>
>

No it doesn't return anything. Here is what the manual says?

http://msdn2.microsoft.com/en-gb/library/ms526482.aspx


--
Anthony Jones - MVP ASP/ASP.NET

Re: Test CDO Message Send Response

am 14.09.2007 18:16:21 von 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.

"Anthony Jones" wrote:
>> Does the .Send method return anything from CDOSYS?
>>
>> Ex:
>> Dim result
>> Set oMail = CreateObject("CDO.Message")
>> ' other code
>> result = oMail.Send
>>
> No it doesn't return anything. Here is what the manual says:
>
> http://msdn2.microsoft.com/en-gb/library/ms526482.aspx
>
>
> --
> Anthony Jones - MVP ASP/ASP.NET
>
>

Re: Test CDO Message Send Response

am 14.09.2007 19:14:44 von Anthony Jones

"jp2code" wrote in message
news:%23dFzYqu9HHA.4712@TK2MSFTNGP04.phx.gbl...
> "Anthony Jones" wrote:
> >> Does the .Send method return anything from CDOSYS?
> >>
> >> Ex:
> >> Dim result
> >> Set oMail = CreateObject("CDO.Message")
> >> ' other code
> >> result = oMail.Send
> >>
> > No it doesn't return anything. Here is what the manual says:
> >
> > http://msdn2.microsoft.com/en-gb/library/ms526482.aspx
> >
> 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



--
Anthony Jones - MVP ASP/ASP.NET