Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Send mail using default client
I want to send an email with attachments using the default email client
through VBA. My current program sends the mail using Microsoft outlook. Is there any way through which I can send an email with an attachment using the default email client which can be lotus notes, Netscape email client etc. My current code goes like this: Dim OutApp As Object Dim OutMail As Object Dim sh As Worksheet Dim samp As String With Application ..EnableEvents = False ..ScreenUpdating = False End With Set sh = Sheets(1) Set OutApp = CreateObject("outlook.Application") OutApp.Session.Logon Set OutMail = OutApp.CreateItem(0) With OutMail ..To = " ..Subject = €œSubject line€ ..Attachments.Add €œC:/text.txt€ ..Body = "Text in body" ..Display |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Send mail using default client
If you just want to send the attachment, then use the Sendmail command. If
you want to write a message in the body, then you might have to use CDO. See Ron de Bruin's site: http://www.rondebruin.nl/sendmail.htm -- Regards, Tom Ogilvy "Sudeep" wrote: I want to send an email with attachments using the default email client through VBA. My current program sends the mail using Microsoft outlook. Is there any way through which I can send an email with an attachment using the default email client which can be lotus notes, Netscape email client etc. My current code goes like this: Dim OutApp As Object Dim OutMail As Object Dim sh As Worksheet Dim samp As String With Application .EnableEvents = False .ScreenUpdating = False End With Set sh = Sheets(1) Set OutApp = CreateObject("outlook.Application") OutApp.Session.Logon Set OutMail = OutApp.CreateItem(0) With OutMail .To = " .Subject = €œSubject line€ .Attachments.Add €œC:/text.txt€ .Body = "Text in body" .Display |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to stop outlook to be my default mail client | New Users to Excel | |||
default mail client | Setting up and Configuration of Excel | |||
Bypass: A program is trying to send mail using Item.Send prompt | Excel Discussion (Misc queries) | |||
How do I set up a new default mail client? | Excel Worksheet Functions | |||
Hyperlink - How to change default e-mail client? | Excel Discussion (Misc queries) |