' A referece to the installed Outlook library must be made under TOOLS | REFERENCES (in VBA) or PROJECT | REFERENCES in (VB)
Sub SendMail()' This routine will work will all incarnations of VBA Dim myOutlook As Object
Dim myMailItem As Object
' Make instance
Set myOutlook = CreateObject("Outlook.Application")
' Make mail item
Set myMailItem = myOutlook.createitem(0)
' Set recipient (internal mail)
myMailItem.Recipients.Add "Doe, John"
' Set recipient (external mail)
myMailItem.Recipients.Add "JDoe@Yahoo.com"
' Set subject
myMailItem.Subject = "test"
' Set body
myMailItem.body = "Quick test!"
' And send it!
myMailItem.send
' Close instance
Set myOutlook = Nothing
End Sub