Send Email Issues...

Willie03

Board Regular
Joined
Jun 21, 2013
Messages
50
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.

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
 
Sorry for the delay in response and I just got back to work today. I tested the code and it worked great!!! Thank you very much for the help and I appreciate the time you took to reply.
 
Upvote 0

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Thank you for acknowledging that I had the solution in mind that you needed.
 
Upvote 0

Forum statistics

Threads
1,223,250
Messages
6,171,036
Members
452,374
Latest member
keccles

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top