Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to email an attachment
Message
 
 
To
11/05/2005 13:12:50
Howard Brown
Howard J. Brown Consulting Services Inc.
North Kingstown, Rhode Island, United States
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Environment versions
Visual FoxPro:
VFP 6
OS:
Windows 2000
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01013015
Message ID:
01013210
Views:
12
Check MAPI Mail Class File #9524. You can use it "AS IS" or pull code that handles attachments from it.

>can anyone show me how to amend Fernando Alverez' code so that I can include an attachment with an e-mail message?
>Thanks...
>H Brown
>
>oleMAPISession = CreateObject ("MSMAPI.MAPISession.1")
>
> With oleMAPISession
>
>    .LogonUI  = .T.              <<<<  This has been changed from .F. to .T.
>    .UserName = cSenderProfile   <<<<  The MAPI profile was used
>    .Password = ""
>
>    .Signon()
>
>    If .SessionID <= 0
>       Error  <<<<
>       Return <<<<
>    endif
>
>    oleMAPIMessages = CreateObject  ("MSMAPI.MAPIMessages.1")
>
>    oleMAPIMessages.SessionID = .SessionID
>
> EndWith
>
> oleMAPIMessages.Compose ()
>
> oleMAPIMessages.MsgSubject  = cMessageSubject
> oleMAPIMessages.MsgNoteText = cMessageText
>
> For nRecips = 1 To nRecipCount
>
>     oleMAPIMessages.RecipIndex       =               nRecips - 1   <<<<  Had to add this
>     oleMAPIMessages.RecipDisplayName = TabRecipInfo [nRecips]      <<<<  For multiple recipients
>     oleMAPIMessages.RecipType        = 1
>
>     oleMAPIMessages.ResolveName ()
>
> EndFor
>
> oleMAPIMessages.Send   (.F.)
> oleMAPISession.Signoff ()
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform