Sending email WITHOUT attaching a workbook?

  • Thread starter Thread starter Kobayashi
  • Start date Start date
K

Kobayashi

I have already checked Ron de Bruin's excellent website but couldn't
find any procedure/function to send an email from Excel without using
the .Sendmail function and having to attach a workbook?

Therefore, does anybody know how I can simply send an email from Excel
using VBA containing Recipient info, Subject and Body text?

Many thanks,

Adrian
 
This is code I have used:

Sub sendemail()

Dim olApp As Outlook.Application

Set olApp = CreateObject("Outlook.Application")

Dim olMail As Outlook.MailItem
Set olMail = olApp.CreateItem(olMailItem)

olMail.To = "recipient@......"

olMail.Subject = "Automated e-mail" 'subject

olMail.Body = "This is the body of the e-mail"

olMail.Send

End Sub


You also have to add the Microsoft Outlook object Library
to your file in order for VB to recognize the objects. In
VBE, Click "Tools>References" and check the Microsoft
Outlook Object library.

HTH
 
Back
Top