Test CDO Message Send Response

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?
jp2code [ Fr, 14 September 2007 16:39 ] [ ID #1820567 ]

Re: Test CDO Message Send Response

"jp2code" <poojo.com/mail> wrote in message
news:%23nbBh0t9HHA.1484 [at] 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
Anthony Jones [ Fr, 14 September 2007 17:34 ] [ ID #1820568 ]

Re: Test CDO Message Send Response

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
>
>
jp2code [ Fr, 14 September 2007 18:16 ] [ ID #1820570 ]

Re: Test CDO Message Send Response

"jp2code" <poojo.com/mail> wrote in message
news:%23dFzYqu9HHA.4712 [at] 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
Anthony Jones [ Fr, 14 September 2007 19:14 ] [ ID #1820572 ]
Webserver » microsoft.public.inetserver.asp.general » Test CDO Message Send Response

Vorheriges Thema: A Cookie Error is a Sometimes Thing
Nächstes Thema: form </input> validation