Email problem

S

Stockwell43

Hello,

I am trying to put in 5 five names in the SendCC and it works fine for the
first three but when I drop to the next line to add the other two, I get a
syntax compile error and the last two name appear in red. Could someone
please help me. I'm sure I am not adding something in the code but don't know
what.

Here is the code I am using:

On Error GoTo EH
Dim SendTo As String, SendCC As String, MySubject As String, MyMessage
As String
SendTo = ""
SendCC = "[email protected],
[email protected], [email protected] &_"
[email protected], [email protected]"
MySubject = "Additional Information Needed"
MyMessage = Me.LoanNumber & vbCr & Me.CustomerFirst & " " &
Me.CustomerLast & vbCr & Me.ErrorCode & _
vbCr & Me.Comments
DoCmd.SendObject acSendNoObject, , , SendTo, SendCC, , MySubject,
MyMessage, True

EH:
If Err.Number = 2501 Then
MsgBox "This email message has not been sent. Message has been
cancelled."
End If

Thanks!!
 
S

Stockwell43

Hi Allan,

Thank you for responding. It didn't work. It still says Syntax error:
Compile Error. If I place all the name in one row it works fine. However, I
don't want to do that because I would like to know how to move it to the next
line and still have it work in case I have more names to add. Is there
another way or did I leave something else out?

Thanks!!!
 
Top