Any ideas?
Thanks
Ginny
HTH
John
Ginny Bonish <gbo...@infonet.tufts.edu> wrote in message
news:388F08D5...@infonet.tufts.edu...
Thanks for your ideas. I looked up CDO and could only find how to use the
Multi-calendar viewer with CDO. You said it was quite simple - can you tell me
how to do it?
Thanks for your help
You COULD use CDO, but it's much easier (although "easier" is relative) to use
MAPI. There's plenty of documentation on M$'s site about MAPI, but essentially you
need an established profile (which you can set up through Outlook) and then your
code will look something like the following:
on error do MapiError with MapiReturnCode
objSession = CreateObject("MAPI.Session")
objSession.logon(Mail_ProfileName)
if MapiReturnCode = .t. then
* "Error establishing session"
*...provide an On Error routine that you can test for an error establishing the
session
endif
select messageDBF && wherever your mail resides
* for each message you want to send, do the following:
objMessage = objSession.Outbox.Messages.Add && create an outbox entry
*____________ Populate the Subject and message
objMessage.Subject = "subject..."
objMessage.Text = "text of message..."
*if you want to handle multiple recipients, there will be one of the following
for each recip...
objRecip = objMessage.Recipients.add
objRecip.name = xName && recip's full email address
* You can also use Outlook's address book to resolve names if you want to; the
code here assumes you have the email address
objRecip.Type = 1
objRecip.Resolve
objMessage.Update
objMessage.Send(1, 0, 0) && puts copy of message in sent folder after it's sent
The preceding code puts a message into Outlook's outbox, but doesn't send it. (It
will be sent whenever Outlook is goosed to send outgoing mail.) If you want to
force Outlook to do the send programmatically, you will have to write a VBS script
that you execute from within FoxPro. The script essentially mimics the keystrokes
that you would use to force Outlook to get and send mail immediately.
There's a ton of documentation on MAPI on MSDN and M$'s knowledgebase. Good luck
paula berg wrote in message <388F656C...@princetoncyber.com>...
LOCAL loSession
loSession = CREATEOBJECT("mapi.session")
loSession.Logon(your mapi profile goes in here) && this is stored in the
registry under HKEY_CURRENT_USER\Software\Microsoft\Windows
NT\CurrentVersion\Windows Messaging Subsystem\Profiles
for NT. I don't remember the key for Win 98, but you should be able to find
it easily enough.
LOCAL loNew
loNew = loSession.Outbox.MESSAGES.ADD()
loNew.Subject = "Message With Error"
lcMessageText = CRLF + "Message File Attached" + CRLF
loNew.TEXT = lcMessageText
LOCAL loAttach
loAttach = loNew.Attachments.ADD()
loAttach.TYPE = 1
loAttach.SOURCE = FULLPATH("somefilename")
LOCAL loSendTo
loSendTo = loNew.Recipients.ADD()
loSendTo.NAME = "fr...@someaddress.com"
loSendTo.TYPE = 1
loSendTo.Resolve()
loNew.UPDATE()
loNew.SEND(1,0,0)
loSession.Logoff()
MESSAGEBOX("Message Sent", MB_OK+MB_ICONINFORMATION, _SCREEN.CAPTION)
RELEASE ALL LIKE lo*
To find CDO in MSDN, look under platform SDK and Messaging and Collaboration
Services.
HTH
John
Ginny Bonish <gbo...@infonet.tufts.edu> wrote in message
news:388F27C9...@infonet.tufts.edu...
--
John Harvey
http://home.att.net/~john.harvey/vfpstuff.htm
I hope this help.s
Bob
John Dobson <dob...@asm.orguk> wrote in message
news:Or#65OKa$GA.1908@cppssbbsa06...