How can I tell if the Email I send using MSMAPI32 is successfully sent or if
the user presse the Cancel button?

I can issue .OLESESISON.Send(1) which pops up the send dialog but I want to
know if the user presed Send or Cancel.

Cheers
David

Re: Sending email from VFP using MSMAPI32 by Eric

Eric
Thu Oct 13 00:56:20 CDT 2005

The MAPIMessages control generates an error if you cancel the Send dialog.
Here's a sample:
<vfp_code>
LOCAL loSession, loMessages
loSession = CREATEOBJECT( "MSMAPI.MAPISession" )
loSession.Signon()
loMessages = CREATEOBJECT( "MSMAPI.MAPIMessages" )
loMessages.SessionID = loSession.SessionID
WITH loMessages
.Compose()
.RecipDisplayName = "User"
.RecipAddress = "SMTP:user@domain.abc"
.RecipType = 1
.MsgSubject = "blah"
.MsgNoteText = "blah blah"
TRY
.SEND(.T.)
CATCH TO Ex
?Ex.Message
ENDTRY

ENDWITH
loSession.Signoff()
</vfp_code>
--
Eric den Doop
www.foxite.com - The Home Of The Visual FoxPro Experts
VFP MVP

"David Younger" <davidyounger1@hotmail.com> wrote in message
news:uDQ6YU5zFHA.2880@TK2MSFTNGP12.phx.gbl...
> How can I tell if the Email I send using MSMAPI32 is successfully sent or
> if
> the user presse the Cancel button?
>
> I can issue .OLESESISON.Send(1) which pops up the send dialog but I want
> to
> know if the user presed Send or Cancel.
>
> Cheers
> David
>
>



Re: Sending email from VFP using MSMAPI32 by man-wai

man-wai
Thu Oct 13 08:18:08 CDT 2005

David Younger wrote:
> How can I tell if the Email I send using MSMAPI32 is successfully sent or if
> the user presse the Cancel button?

Search for "send smtp attachment" in fox.wikis.com. You could have finer
control with that function.

--
.~. Might, Courage, Vision. http://www.linux-sxs.org
/ v \
/( _ )\ Linux 2.6.13
^ ^ 21:17:01 up 23:21 0 users 1.30 1.27

Re: Sending email from VFP using MSMAPI32 by David

David
Sun Oct 16 21:26:29 CDT 2005

I tried it with outlook express and there is no Cancel button so I pressed
the X to close the window and it did not trigger the Catch.

Cheers
David


"Eric den Doop" <ericdendoop@xspamblockxfoxite.com> wrote in message
news:O1D2Pq7zFHA.596@TK2MSFTNGP12.phx.gbl...
> The MAPIMessages control generates an error if you cancel the Send dialog.
> Here's a sample:
> <vfp_code>
> LOCAL loSession, loMessages
> loSession = CREATEOBJECT( "MSMAPI.MAPISession" )
> loSession.Signon()
> loMessages = CREATEOBJECT( "MSMAPI.MAPIMessages" )
> loMessages.SessionID = loSession.SessionID
> WITH loMessages
> .Compose()
> .RecipDisplayName = "User"
> .RecipAddress = "SMTP:user@domain.abc"
> .RecipType = 1
> .MsgSubject = "blah"
> .MsgNoteText = "blah blah"
> TRY
> .SEND(.T.)
> CATCH TO Ex
> ?Ex.Message
> ENDTRY
>
> ENDWITH
> loSession.Signoff()
> </vfp_code>
> --
> Eric den Doop
> www.foxite.com - The Home Of The Visual FoxPro Experts
> VFP MVP
>
> "David Younger" <davidyounger1@hotmail.com> wrote in message
> news:uDQ6YU5zFHA.2880@TK2MSFTNGP12.phx.gbl...
> > How can I tell if the Email I send using MSMAPI32 is successfully sent
or
> > if
> > the user presse the Cancel button?
> >
> > I can issue .OLESESISON.Send(1) which pops up the send dialog but I want
> > to
> > know if the user presed Send or Cancel.
> >
> > Cheers
> > David
> >
> >
>
>