ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Sending email WITHOUT attaching a workbook? (https://www.excelbanter.com/excel-programming/277957-sending-email-without-attaching-workbook.html)

Kobayashi[_5_]

Sending email WITHOUT attaching a workbook?
 
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



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/


Ian[_8_]

Sending email WITHOUT attaching a workbook?
 
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 "ToolsReferences" and check the Microsoft
Outlook Object library.

HTH




-----Original Message-----
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



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from

http://www.ExcelForum.com/

.


Ron de Bruin

Sending email WITHOUT attaching a workbook?
 
Hi Adrian

You don't look good<g
http://www.rondebruin.nl/sendmail.htm#body


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Kobayashi" wrote in message ...
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



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/





All times are GMT +1. The time now is 05:42 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com