0

I need to send an email with few attachments to different clients. The attachments are put on different folders, each one named by the name.

For example..

In column "A" = Clients name In column "B" = Clientes emails In column "C" = The subject In column "D" = The email body (ex: Hello, here the attachemtn) In column "E" = The folder where the attachemtns are on 

I need to have one routine for each cliente ( +- 14 clientes ). Noting having any success on this. Any help?

Sub SendEMAIL()

Dim MyOlapp As Object, MeuItem As Object Set MyOlapp = CreateObject("Outlook.Application") Set MeuItem = MyOlapp.CreateItem(olMailItem) With MeuItem .to = Range("A2") .Subject = Range("D2") .Body = "Range("C2") End With End Sub 

1 Answer 1

1

Here's a script I use for Outlook to send an email with attachments...

Sub NLANghtRpt() Dim myItem As Outlook.MailItem Dim myAttachments As Outlook.Attachments 'location of your files myPath1 = "C:\Users\username\Documents\" Set myItem = Application.CreateItem(olMailItem) With myItem .To = "whoever you want to send to" .CC = "whoever you want to copy" .Subject = "your subject here" .Body = "NIGHTLY REPORT FOR " & Format(Now, "mm.dd.yy") ' I use the previous line for a generic message with a time stamp Set myAttachments = myItem.Attachments myAttachments.Add myPath1 & ("ReportSchedule.xls") myAttachments.Add myPath1 & ("ReportBooks.xls") myAttachments.Add myPath1 & ("ReportHours.xls") myItem.Display End With End Sub 

Of course, edit to fit your environment. Good luck

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.