Sub mainSub()
Dim lngRowNo As Long
Dim strDueDate As String
For lngRowNo = 2 to Cells(Rows.Count, 1).End(xlUp).Row
strDueDate = ThisWorkbook.Sheets("Sheet1").Range("A" & lngRowNo).Value2 'Assume due date is column B
If strDueDate = Date() Then
sendEmai(ThisWorkbook.Sheets("Sheet1").Range("C" & lngRowNo).Value2 'Assume email address on column C
End If
Next lngRowNo
End Sub
Sub sendEmail(strMailAddress As String)
Dim appOutlook As Object
Dim mEmail As Object
Set appOutlook = CreateObject("Outlook.Application")
Set mEmail = appOutlook.CreateItem(olMailItem)
With mEmail
.To = strMailAddress
.CC = ""
.BCC = ""
.Subject = "This is the subject"
.HTMLBody = "This is the body of the email"
'.Attachments.Add
'.Display
.Send
End With
Set mEmail = Nothing
Set appOutlook = Nothing
End Sub