Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to email an attachment
Message
From
11/05/2005 13:12:50
Howard Brown
Howard J. Brown Consulting Services Inc.
North Kingstown, Rhode Island, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
How to email an attachment
Environment versions
Visual FoxPro:
VFP 6
OS:
Windows 2000
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01013015
Message ID:
01013015
Views:
61
Hello all,
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 ()
Next
Reply
Map
View

Click here to load this message in the networking platform