Guest double-helix Posted July 12, 2002 Posted July 12, 2002 This needs a COM reference in order to work, so u will need Microsoft Outlook installed in order for this to work. First, right click on the references tab, and choose Add reference. The, under the COM tab, choose Microsoft Outlook Object Model. Then, at the top of the code, insert the key statement : Imports Outlook Add a command button to the form that you are working with, then name it cmdOutlookMail. Double click on it to display the code view, then insert the following code : dim objectMail as new Outlook.Application() dim objectItem as MailItem objectItem = objectMail.CreateItem(OLitemType.olMailItem) With objectItem .Subject = "Visual Basic Forums Rock" .To = "someidiot@williskool.com" .CC = "anotheridiot@willisl337.com" .Body = "Visit http://www.scripts-cs.tk" .Attachments.add("C:\Autoexec.bat") .Send() End With MsgBox("Mail Sent") End Sub 'Note that cc, subject, body etc can all be replaced with other 'Things, even variables, etc:D OK, thats it. get back to me for info :p Quote
Dodgeram01 Posted July 13, 2002 Posted July 13, 2002 COM...that means that the client computer for this program would also need to have Outlook installed, correct? Quote Dodge Grab Life By The Horns
Recommended Posts