send emails with an attachment from Excel list

Send emails with an attachment from Excel list. Emails each with
different attachments from a list. Check out my online courses
Become an Affiliate and earn 25% on Course Sales

Sub Send_email_fromexcel()
Dim edress As String
Dim subj As String
Dim message As String
Dim filename 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) (the symbol for not equal to) “”

Set outlookapp = CreateObject(“Outlook.Application”)
Set outlookmailitem = outlookapp.createitem(0)
Set myAttachments = outlookmailitem.Attachments
path = “C:UsersBarbDocumentsstatements”
edress = Sheet1.Cells(x, 1)

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

lastrow = lastrow + 1
edress = “”
x = x + 1
Loop
Set outlookapp = Nothing
Set outlookmailitem = Nothing

End Sub

For more help visit my website or email me at [email protected].

Contact me regarding customizing this template for your needs.

Excel one-on-one on-line training available. Email me to arrange.

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.

Rate this post