Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sending E-Mail via Outlook
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00099107
Message ID:
00099596
Views:
23
Pete,

Like I mentioned before the \samples\solution\solution.app has some code in there. Here's another test program sample for you:
activate window "debug output"

* simple test email program using MAPI

oleMAPISession = createobject( "MSMAPI.MAPISession.1" )

* Signon to mail
with oleMAPISession
   .UserName = "Test"
   .Password = ""
   .Signon()
   * Check the SignOn status
   if ( .SessionID > 0 )
      oleMAPIMessages = createobject( "MSMAPI.MAPIMessages.1" )
      * tell the message the SessionID
      oleMAPIMessages.SessionID = .SessionID
      debugout "Successful mail log on"
   else
      debugout "Mail login failed"
      return
   endif
endwith

* Send an email

with oleMAPIMessages
   .Compose()

* Set the Recipient name and resolve
   .RecipDisplayName = "DavidFrankenbach@worldnet.att.net"
   .RecipType = 1
   .ResolveName()

   .MsgSubject = "This is the Subject"
   .MsgNoteText = "This is the email text"

   .Send( .f. )
endwith

* Read the InBox

with oleMAPIMessages
   .Fetch()
   for i = 0 to .MsgCount-1
      .MsgIndex = i
      debugout .MsgSubject
   endfor
endwith

* Signoff

oleMAPISession.Signoff()


>thanks for your help, I have located the MAPI controls but find the help files unhelpful, have you any sample code ( VFP preferably ) that would demonstrate sending and receiving mail ( just the bare bones would be fine )
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Reply
Map
View

Click here to load this message in the networking platform