Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


How to Send Mail from Outlook using OLE

Keywords: 	 Send Mail Outlook OLE

Question:

I saw a piece of code up here before that did this (without using Binary Pokes) but I can't find it anymore. I also checked the old webboard but still can't find it. If anyone has that code or knows what I'm talking about your help would be appreciated.

Alternately if you know how to modify the binary poke code example from the windowware help page to NOT force a login display screen and to NOT send a confirmation email to the sender, etc.

Answer:

Try this :
Csubject = ""
Cname = ""
Cattach = "c:\autoexec.bat"
Cbody = ""

objOutlook = ObjectOpen("Outlook.Application")

; create object
objOutlookMsg = objOutlook.createitem(0)
objOutlookRecip = objOutlookMsg.Recipients
objOutlookAttach = objOutlookMsg.Attachments

;objoutlookmsg.display

objOutlookRecip.Add(Cname)
;objOutlookAttach.Add(Cattach)
objOutlookmsg.Subject = Csubject
objOutlookmsg.Body = Cbody

objOutlookMsg.Send

ObjectClose(objOutlook)

exit 

Article ID:   W14391
Filename:   How to Send Mail from Outlook using OLE.txt