Urgent help required on VE Project. I want to send multiple mail with attachment on click
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) <> ""
'For x = 2 To 4
Set outlookapp = CreateObject("Outlook.Application")
Set outlookmailitem = outlookapp.createitem(0)
Set myAttachments = outlookmailitem.attachments
path = "D:\Prabhakar Desktop\GEOTAGGING\outlet upload"
edress = Sheet1.Cells(x, 1)
subj = Sheet1.Cells(x, 2)
filename = Sheet1.Cells(x, 3)
attachment = path + filename
MsgBox edress
outlookmailitem.To = edress
outlookmailitem.cc = ""
outlookmailitem.bcc = ""
outlookmailitem.Subject = subj
outlookmailitem.body = "please find your statement attached" & vbCrl & "Best"
myAttachements.Add (attachment)
outlookmailitem.display
outlookmailitem.send
lastrow = lastrow + 1
edress = ""
x = x + 1
Loop
'Next x
Set outlookapp = Nothing
Set outlookmailitem = Nothing
End Sub