I have this macro here that is supposed to send emails to the people on column "C" and CC the people in column "F" and its supposed to attach a file located in my documents.
The issue that I'm having is that it does not display the emails of each of the people on column "C" nor does it attach the file.
NOTE: The attachment is the same for all emails that have to be sent.
The issue that I'm having is that it does not display the emails of each of the people on column "C" nor does it attach the file.
NOTE: The attachment is the same for all emails that have to be sent.
Code:
Sub Send_Email()
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
Dim cel As Range
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
For Each cel In Range(("C2"), Range("C2").End(xlDown))
strbody = "Hi there" & vbNewLine & vbNewLine & _
"My name Is William" & vbNewLine & _
"I work at Fair" & vbNewLine & _
"Bye" & vbNewLine & _
"WH"
On Error Resume Next
With OutMail
.To = cel.Value '"email.address@fair.com"
.CC = cel.Offset(0, 3).Value
.BCC = ""
.Subject = "Information You Requested"
.Body = strbody
.Display
'.Attachments.Add ("C:\test.txt")
'.Send
End With
On Error GoTo 0
Next cel
Set OutMail = Nothing
Set OutApp = Nothing
End Sub