Well, quailco.
All I know of you is what you wrote here. If you know fox for so long, you could have answered your last question yourself. It made the impression you're a beginner not knowing anything about programming. Any code can be done in a batch once it's without any interaction, can't it?
Just an obvious hint: You don't need to create the two MAPI COM objects for each mail, the core part is from compose() to send(1) and only that would need to be in a loop.
And then if you want to distribute that look into redsit.txt in HOME() to learn what you can redistribute and see it mentions MSMAPI32.MSM for distributing the MAPI OCXes. It's not just the msmapi32.ocx.
There are further ways, Craig Boyd once wrote 10 ways to send mail, and as you see there is more than one FAQ on how to send mail. What you found only has Winsock dependency and you would also need to ensure you distribute that (see MSWINSCK.MSM in redist.txt), it's only more common to be existing. Well, it
was more common at the time that code was written. The main point though is, it assumes you only need simple authentication to the mail server and only implements the least few SMTP commands to send a mail and is still so much more code. The most sample code about sending mail you find does not do all that, as it's tedious and subject to change. A MAPI complient mail client will a) make the mail server communication for you and b) already be configured about mailserver, port, authentication, etc. You don't need to ask your users any security relevant informations, their mail client knows.
To send mail this way also is within VFPs own samples, by the way:
Code:
Cd Addbs(Home())+"samples/solution/ole"
Modify Form sendmail.scx
Bye, Olaf.
Olaf Doschke Software Engineering