Send Two Attachments With An Email From Excel



Send email from a list in Excel with two attachments. Send two attachments with an email from Excel. Two file names on a list on an Excel Worksheet. Send email from a list with two different attachments. Send a list of files to a list of email address in Excel.
Check out my online courses

For more help visit my website or email me at easyexcelanswers@gmail.com.

Contact me regarding customizing this template for your needs.

Click for online Excel Consulting

I am able to provide online help on your computer at a reasonable rate.

Check out my next one-hour Excel Webinar

I use a Blue condensor Microphone to record my videos, here is the link

Check out Crowdcast for creating your webinars

If you need to buy Office 2019 follow

I use Tube Buddy to help promote my videos
Check them out

Follow me on Facebook

TWEET THIS VIDEO

Follow me on twitter
easyexcelanswers

IG @barbhendersonconsulting

You can help and generate a translation to you own language

*this description may contain affiliate links. When you click them, I may receive a small commission at no extra cost to you. I only recommend products and services that I’ve used or have experience with.
code
Sub Send_email_fromexcel()
Dim edress As String
Dim subj As String
Dim message As String
Dim filename As String
Dim filename2 As String
Dim outlookapp As Object
Dim outlookmailitem As Object
Dim myAttachments As Object
Dim path As String
Dim lastrow As Integer
Dim attachment As String
Dim x As Integer

x = 2

Do While Sheet1.Cells(x, 1) (does not equal) “”

Set outlookapp = CreateObject(“Outlook.Application”)
Set outlookmailitem = outlookapp.createitem(0)
Set myAttachments = outlookmailitem.Attachments
edress = Sheet1.Cells(x, 1)
path = Sheet1.Cells(x, 2)
subj = Sheet1.Cells(x, 6)
filename = Sheet1.Cells(x, 3)
‘attachment = path + filename
Set myAttachments = outlookmailitem.Attachments

edress = Sheet1.Cells(x, 1)
path = Sheet1.Cells(x, 4)
filename = Sheet1.Cells(x, 3)
filename1 = Sheet1.Cells(x, 5)
attachment = path + filename
attachment = path + filename1
outlookmailitem.To = edress
outlookmailitem.cc = “”
outlookmailitem.bcc = “”
outlookmailitem.Subject = subj
outlookmailitem.body = “Please find your compensation summary statement attached.” & vbCrLf & “Best Regards”
myAttachments.Add (attachment)
myAttachments.Add (attachment)
outlookmailitem.display
‘outlookmailitem.send
lastrow = lastrow + 1
edress = “”

x = x + 1
Loop

Set outlookapp = Nothing
Set outlookmailitem = Nothing

End Sub

Watch more new videos about Excel Office | Synthesized by Mindovermetal English

Rate this post

Bài viết liên quan

Theo dõi
Thông báo của
guest
7 Comments
Cũ nhất
Mới nhất Được bỏ phiếu nhiều nhất
Phản hồi nội tuyến
Xem tất cả bình luận
Kristin Brown-Morse

Hi Barb, I have tried this but am stuck. I would love to have some of your help with trying to attach multiple files in an email. At this point my attachment is repeating. I see you don't have any consulting hours left for me to grab today. Happy to pay you, for all the assistance you provided. Is that something we could still do today or before Monday?

Matthew Bagley

Barb how can I keep my email signature on the email? Thanks!

Yeap Goh

Hi Barb, thanks for the video. Is that possible if I wish to have multiple attachment under the same column?

The way this code is written is incorrect. If you write it this way you send the same attachment twice because you list both lines together at the top instead of in the correct sequential order. If you don't want it in sequential order and would rather do it with instance variables then you would have to rename the second variable from "attachment" to something else, possibly "attachment2". Do not follow the code listed above word for word or you will send a mass email with duplicate attachments! Try this instead:

attachment = path + filename
attachment2 = path + filename2

PAWAN KHURANA

There is some problem in this coding. Do not take the identical file in the second attachment and then try it.

Ajay Babu Karsinapu

Thanks Barb…. this is wonderful… i would like to see if we can use any loops where we can do multiple attachments for each unique email address in column 1… just a thought as a beginner. 🙂

Ismail Ismaili

i'm really still can't understand VBA i don't know why but it still looks difficult for me