Email Issues in MS Access 2003

By swelch_z ·
I have a MS Access application that sends email to a list of recipients in a sub-form. This worked without issue in Lotus Notes but following a migration to Outlook I get a 'Run-time error '2295' (Unknown message recipient), an ideas? Here is the code:

Private Sub cmdEmail_Click()

Dim strBody As String
strBody = "You have just completed a training course and Technical Services would appriciate your participation in our 'Training Survey'" & vbCrLf & vbCrLf + "Training Course: " + Me.CourseName & vbCrLf & vbCrLf & "Trainer: " + Me.Trainer & vbCrLf & vbCrLf & "iCON URL:" & vbCrLf & vbCrLf & Me.IconURL + " " & vbCrLf & vbCrLf & vbCrLf & "Thankyou in advance for your participation." & vbCrLf & "" & vbCrLf & vbCrLf & " "
Dim strTitle As String
strTitle = "Training Course Survey"
Dim strAddress As String
Dim strCC As String

Dim rs As DAO.Recordset
Set rs = Me.EmailSurveysSubform.Form.Recordset

While Not rs.EOF
If Trim(rs.Fields("Email")) <> "" Then
strAddress = strAddress & rs.Fields("email").Value & "; "
'strAddress = rs.Fields("email").Value & "; "
End If

DoCmd.SendObject , , , strAddress, strCC, , strTitle, strBody

End Sub

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

Look at strBody closely. What do you see?

by ThumbsUp2 In reply to Email Issues in MS Access ...

Pay particular attention to where you are concatenating everything. Why are the plus signs in there?

Also, the whole string needs to be on one line unless you use the "continue" character.

Collapse -

Problem Solved

by swelch_z In reply to Look at strBody closely. ...

The issue wasn't with the body but with Outlooks dislike of no space between the semi colon and the previous email address in the string. Lotus Notes automatically inserted a space, Outlook did not. The solution was this:
Replace the following Value & "; " with Value & " :" Simply move the space.

Back to Desktop Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums