Email send not working with To and CC

drmingle

Board Regular
Joined
Oct 5, 2009
Messages
229
This code works beautifully when there is email addresses in the CC field, but when there is no value in the CC field than an error code 2295 pops up stating unknown message recipient.

I need help with what I think should be a conditional snippet: if Me.CC = " ", then Me.From only else Me.From and Me.CC.

Code:
Private Sub EmailOriginator_Click()
DoCmd.SendObject _
    , _
    , _
    , _
    """" & Me.From & """", _
    """" & Me.CC & """", _
    , _
    "COMPLETED: " & Me.ID & " " & Me.Subject, _
    "SOS Comments: " & Me.CommentSOS & vbNewLine & vbNewLine & "APSIA Comments: " & Me.CommentAPSIA & vbNewLine & vbNewLine & "Original Message: " & Me.Message & vbNewLine, _
    True

Me.Status = "Closed"

End Sub

Any help would be appreciated...
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.

Forum statistics

Threads
1,224,520
Messages
6,179,267
Members
452,902
Latest member
Knuddeluff

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