sorry put the set outside the loop
try this
Private Sub Workbook_Open()
Dim i As Long
Dim OutApp, OutMail As Object
Dim strto, strcc, strbcc, strsub, strbody As String
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
For i = 2 To Range("b65536").End(xlUp).Row
Set OutMail = OutApp.CreateItem(0)
If Day(Cells(i, 2).Value) & Month(Cells(i, 2).Value) = Day(Now()) & Month(Now()) Then
strto = "vijay1279@rediffmail.com" 'email address
strsub = "Happy Birthday " & Cells(i, 1).Value
strbody = "Hi " & Cells(i, 1).Value & "," & vbNewLine & vbNewLine & _
"Your birthday is " & Cells(i, 2).Value
With OutMail
.To = strto
.Subject = strsub
.Body = strbody
.Send
'.display
End With
On Error Resume Next
End If
Next
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
also put on error statement
Bookmarks