Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending e-mails to Windows Live Mail Outbox, using MAPI 1

Status
Not open for further replies.

SitesMasstec

Technical User
Sep 26, 2010
502
BR
Hi colleagues!

I have been using a Visual FoxPro 9 application (with MAPI commands) which sends e-mails automaticaly to the Outlook Express. Operating system is Windows XP. It is working well for years.

Now, it installed the same Visual FoxPro 9 application in a computer with Windows 7 , 64bits operating system, and the mail application is Windows Live Mail (there is no Outlook Express for Windows 7), which I configured accordingly, to receive mails from the Visual FoxPro 9 application.

But my Visual FoxPro 9 application presents error when it try to send mails to Windows Live Mail. Do you have any solution?

Thank you.
 
As to Windows Live Mail - some web searching indicates that there is no Microsoft API for it.
Although there might be a non-Microsoft one at:
Regardless, you might be out of luck with it.

I never had to use Outlook Express but here is another alternative...

You can purchase, fairly in-expensively, one of the older versions of M$ Office and install it onto your Windows 7 machine. Then send your emails out through it's Outlook

Look at: or:
Good Luck,
JRB-Bldr
 
The problem isn't OE vs Live Mail, but discontionued MAPI DLLs/OCXes you used, most probably.
What's the error you get with what code used?

MAPI itself still is a standard and should be possible, eg MSMAPI.MAPISession is present on my Windows 7 64bits. Simply try, whether o = CreateObject("MSMAPI.MAPISession") and also o = CreateObject("MSMAPI.MAPIMessages") work in the command window.

Even if not, there are many ways to send mails, using Winsock or using CDO.Message or using Blat.dll/blat.exe and many more, you even don't depend on any mail client.

Bye, Olaf.





 
The following works om windows 10 64 bit. Also on windows 7 but it tries to config vfp jusy hit cancel. It started in Outlook Express and still works with some mods. It can also do multi attachments.

Dimension tafiles(1)
Dimension aryAttachments(1)
Dimension arybody(1)
aryAttachments(1) = "c:\aux7d\report\ops.xls"
arybody = "Air/Boat Crew Status - YTD"

If SendViaMAPI("FROM EMAIL", "TO EMAIL", "Air/Boat Crew Status", @arybody, @aryAttachments)
Else
Messagebox("Problem sending email!")
Endif
Clear
Set Default To c:\aux7d
Close Tables

****************************************************
Function SendViaMAPI(tcFrom, tcTo, tcSubject, tcBody, tafiles)
****************************************************
On Error &&
Local loSession, loMessages
loSession = Createobject( "MSMAPI.MAPISession" )
loSession.Signon()
If (loSession.SessionID > 0)
loMessages = Createobject( "MSMAPI.MAPIMessages" )
loMessages.SessionID = loSession.SessionID
Endif
With loMessages
.Compose()
.RecipDisplayName = tcTo
.RecipType = 1
.MsgSubject = tcSubject
.MsgNoteText = tcBody
If Pcount() > 4
For lnCountAttachments = 1 To Alen(tafiles)
.AttachmentIndex = .AttachmentCount
.AttachmentName = Justfname(tafiles(lnCountAttachments))
.AttachmentPosition = .AttachmentIndex
.AttachmentPathName = tafiles(lnCountAttachments)
Endfor
Endif
.Send(.T.)
Endwith
loSession.Signoff()
Store .Null. To loSession, loMessages
Release loSession, loMessages
Return .T.
Endfunc
 
I wonder if installing one of the Outlook Express replacements would solve the problem? I'm thinking of programs like OE Classic. My understanding is that they use the same DLLs, etc. as OE, but with a different user interface.

Just a thought.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
tfs is using the OLE MAPI helper objects I also found to exist in my Win7. That's +1 for these classes being available.
Not sure, if it is just because I also have Outlook (MS Office Outllok) installed.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top