Mentioned code is used to attach PDF files to mail from a destination . I need each mail to have 1 attachement based on 'Cells(v, 3).Value' . but from second mail onwards, previous attachment is also getting attached to mail.i.e first mail is having the right attachment,second mail has the right attachment + the attachment of previous mail and so on..Please help out..
Code:
For i = 1 To valcount
address = Cells(v, 25).Value
attachment = "C:\Users\nikhil.r\Desktop\Temp\" & Cells(v, 3).Value & ".pdf"
MsgBox (attachment)
With NewMail
.Subject = "Skill baselining assessment score card"
.From = "academy@payoda.com"
.To = address
.CC = ""
.BCC = ""
.HTMLBody = "Hi,<br><br>Find your scorecard attached<br><br>Best Regards<br>L&D"
' For multiple Attachment you can add below lines as many times
.AddAttachment attachment '"C:\ExcelMacro-help.xls"
End With
NewMail.Send
v = v + 1
Next