Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Email with Access and Lotus Notes Version 5.05

Status
Not open for further replies.

rphbrew

Technical User
Nov 30, 2002
40
US
I was able to send emails to multiple recipients, now it breaks up the email address after the first name at the ampersan sign,

any suggestions on how to send the emails?
 
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?

greetz

Tom
 
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 notesdb = notessession.GetDatabase("", "")
Call notesdb.OPENMAIL
DoCmd.OutputTo acOutputReport, "PLANS Query", acFormatRTF, "C:\Plans.doc"
DoCmd.OutputTo acOutputReport, "REPORTS Query", acFormatRTF, "C:\Reports.doc"
DoCmd.OutputTo acOutputReport, "VECO Query", acFormatRTF, "C:\VECO.doc"
strCurrentPath = "C:\Plans.doc"
strCurrentPath1 = "C:\Reports.doc"
strCurrentPath2 = "C:\VECO.doc"

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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top