Sub SendEmail()
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
Dim toemail As String
Dim ccemail As String
Dim lastrow As Long
Dim emailsubject As String
Dim rowtrack As Integer
Dim attachmentpath As String
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
lastrow = Range("A" & Cells.Rows.Count).End(xlUp).Row
For rowtrack = 2 To lastrow
'To Address
toemail = Range("B" & rowtrack).Value
'CC address
ccemail = Range("C" & rowtrack).Value
'Email subject
emailsubject = Range("D" & rowtrack).Value
'Body of email
strbody = Range("E" & rowtrack).Value
'Attachment path
attachmentpath = Range("F" & rowtrack).Value & Application.PathSeparator & Range("G" & rowtrack).Value
On Error Resume Next
With OutMail
'To Email Address
.To = toemail
'CC Email Address
.CC = ccemail
'You can also specify BCC if required
'.BCC = ""
'Email Subject
.Subject = emailsubject
'Body of the email
.Body = strbody
'Email attachment
.Attachments.Add attachmentpath
.Send
End With
On Error GoTo 0
Next
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
Dim toemail As String
Dim ccemail As String
Dim lastrow As Long
Dim emailsubject As String
Dim rowtrack As Integer
Dim attachmentpath As String
Set OutApp = CreateObject("Outlook.Application")
lastrow = Range("A" & Cells.Rows.Count).End(xlUp).Row
For rowtrack = 2 To lastrow
Set OutMail = OutApp.CreateItem(0)
'To Address
toemail = Range("B" & rowtrack).Value
'CC address
ccemail = Range("C" & rowtrack).Value
'Email subject
emailsubject = Range("D" & rowtrack).Value
'Body of email
strbody = Range("E" & rowtrack).Value
'Attachment path
attachmentpath = Range("F" & rowtrack).Value & Application.PathSeparator & Range("G" & rowtrack).Value
On Error Resume Next
With OutMail
'To Email Address
.To = toemail
'CC Email Address
.CC = ccemail
'You can also specify BCC if required
'.BCC = ""
'Email Subject
.Subject = emailsubject
'Body of the email
.Body = strbody
'Email attachment
.Attachments.Add attachmentpath
.Send
End With
On Error GoTo 0
Next
Set OutMail = Nothing
Set OutApp = Nothing