Do you use automation for that, or just the simple mailto: line? Since when access breaks up the line? Can you give me more information so I can help you?
Here is the code we are using. This worked when we tested it. now the addresses are being messed up. I do not know if they did something with the mail server after we tested this code.
Private Sub EmailReports(ListSelection As String)
On Error GoTo Failure
Dim rst As Recordset
Dim EmailList As String
Dim notesdb As Object
Dim notesdoc As Object
Dim notesrtf As Object
Dim notessession As Object
Set notessession = CreateObject("Notes.Notessession"
Dim strCurrentPath As String
Dim strCurrentPath1 As String
Dim strCurrentPath2 As String
Set rst = CurrentDb.OpenRecordset(ListSelection, dbOpenSnapshot)
rst.MoveFirst
Do Until rst.EOF 'loop to move through the records in the table
If EmailList = "" Then
EmailList = rst.Fields("email"
Else
EmailList = EmailList & ", " & rst.Fields("email"
End If
rst.MoveNext
Loop
Rem make new mail message
Set notesdoc = notesdb.CreateDocument
Call notesdoc.ReplaceItemValue("Sendto", EmailList)
Call notesdoc.ReplaceItemValue("Subject", "Validation Plans, Reports, and VECR/VECO"
Set notesrtf = notesdoc.CreateRichTextItem("body"
Call notesrtf.AppendText("Please review the following lists and bring any updates to the Validation meeting."
Call notesrtf.AddNewLine(2)
Rem attach Error Report doc's = ActiveDocument.Path + "\" + ActiveDocument.Name
Call notesrtf.EmbedObject(1454, "", strCurrentPath, "Mail.rtf"
Call notesrtf.EmbedObject(1454, "", strCurrentPath1, "Mail.rtf"
Call notesrtf.EmbedObject(1454, "", strCurrentPath2, "Mail.rtf"
Rem send message
Call notesdoc.Send(False)
Call LogEvent("Emails Sent to " & ListSelection & "." 'log event
Set notessession = Nothing
ExitRoutine:
Exit Sub
Failure:
Call DoErrLog(Application.CurrentObjectName, "EmailReports", ERR.Number, ERR.Description, True)
Resume ExitRoutine
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.