Emailing from a list (with attachment)

jaypatel

Active Member
Joined
Nov 25, 2002
Messages
389
i have a list of email addresses (approx 2000) in column a. What i need to do is send them a word document called letter.doc found in the directory c:\my documents to all the email addresses. Is there an easy way to do this. Any help will be appreciated. regards Jay
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

nirvana_

Board Regular
Joined
Mar 25, 2009
Messages
141
Here is a vba script you need to use. All email addresses should be in column A. Attachment should also exist.

Test it first before sending.

Code:
Sub SendToAll()
Dim i As Integer
i = 1
Set myOlApp = CreateObject("Outlook.Application")
'Place all e-mail addresses in column A.
Do While Worksheets(1).Cells(i, 1) <> ""
    Set MyItem = myOlApp.CreateItem(olMailItem)
    With MyItem
            .To = Worksheets(1).Cells(i, 1)
            .Attachments.Add "C:\My Documents\letter.doc"
            .Subject = "My Subject"
            .Display
            .Send
    End With
    i = i + 1
Loop
End Sub
 
Upvote 0

spcalan

Well-known Member
Joined
Jun 4, 2008
Messages
1,247
Here is a vba script you need to use. All email addresses should be in column A. Attachment should also exist.

Test it first before sending.

Code:
Sub SendToAll()
Dim i As Integer
i = 1
Set myOlApp = CreateObject("Outlook.Application")
'Place all e-mail addresses in column A.
Do While Worksheets(1).Cells(i, 1) <> ""
    Set MyItem = myOlApp.CreateItem(olMailItem)
    With MyItem
            .To = Worksheets(1).Cells(i, 1)
            .Attachments.Add "C:\My Documents\letter.doc"
            .Subject = "My Subject"
            .Display
            .Send
    End With
    i = i + 1
Loop
End Sub

I like the "simple" vba code to send an attachment via Outlook, but Instead of sending thesame file 10 times ( for 10 people on the list ).
How would the vba code change to send 1 email ( that contained 10 email addresses ?)
 
Upvote 0

Forum statistics

Threads
1,191,671
Messages
5,987,957
Members
440,121
Latest member
eravella

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top