General information
Category:
ActiveX controls in VFP
Title:
How to email an attachment
Environment versions
Network:
Windows 2003 Server
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only