WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

OLE and Outlook
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

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 = ObjectCreate("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

objOutlook = 0

exit 

Article ID:   W14391
Filename:   How to Send Mail from Outlook using OLE.txt
File Created: 2013:06:19:15:17:02
Last Updated: 2013:06:19:15:17:02