I am trying to send email from Excel. The code I have will insert the subject and body from an excel sheet and send the email, but won't insert the recipient, so it just gets sent to me. This is what I have:
Sub SendEMail()
Dim objOL As Object
Dim objOLMsg As Object
Dim objOLRecip As Object
Set objOL = CreateObject("Outlook.Application"
For i = 1 To 3
Set objOLMsg = objOL.CreateItem(olMailItem)
With objOLMsg
Set objOLRecip = .Recipients.Add(Sheets(1).Cells(i, 3))
objOLRecip.Type = olto
.Subject = Sheets(1).Cells(i, 1)
.Body = Sheets(1).Cells(i, 2)
.Send
End With
Next i
Set objOL = Nothing
End Sub
Sub SendEMail()
Dim objOL As Object
Dim objOLMsg As Object
Dim objOLRecip As Object
Set objOL = CreateObject("Outlook.Application"
For i = 1 To 3
Set objOLMsg = objOL.CreateItem(olMailItem)
With objOLMsg
Set objOLRecip = .Recipients.Add(Sheets(1).Cells(i, 3))
objOLRecip.Type = olto
.Subject = Sheets(1).Cells(i, 1)
.Body = Sheets(1).Cells(i, 2)
.Send
End With
Next i
Set objOL = Nothing
End Sub