0
I've this code bellow. It save the email with all receipts but it only send to the first receipt;
On Lotus sent folder --> teste@hotmail.com;test@gmail.com
On the Receive end --> test@hotmail.com; test
The code is;
rst![Email] --> test@test.com,test@test2.com It can be 1, 2 or more;
Private Sub Command43_Click()
Dim rst As DAO.Recordset
Dim strBody
Dim Sendto1, Esubject As String
Dim Session As Object
Dim EmbedObj1 As Object
Const ForReading = 1
Const ForWriting = 2
Const ForAppending = 8
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile("L:\DOCS.txt", ForReading)
strBody = f.ReadAll
f.Close
Set rst = Form_PD_S_Docs.RecordsetClone
While Not rst.EOF
Sendto1 = rst![Email]
Esubject = "Teste" & " " & rst![SAP] & " " & rst![Nome]
SendEmail Sendto1, Esubject, strBody2
rst.MoveNext
Wend
End Sub
-----/------
Public Sub SendEmail(ByVal pvTo, ByVal pvSubj, ByVal pvBody)
Dim Session As Object
Dim EmbedObj1 As Object
On Error GoTo errorhandler1
Set Session = CreateObject("Notes.NotesSession")
UserName = Session.UserName
MailDbName = Left$(UserName, 1) & Right$(UserName, (Len(UserName) - InStr(1, UserName, "
"))) & ".nsf"
Set Maildb = Session.GetDatabase("", MailDbName)
If Maildb.IsOpen = True Then
Else
Maildb.OPENMAIL
End If
Set MailDoc = Maildb.CreateDocument
MailDoc.Form = "Memo"
With MailDoc
.SendTo = pvTo
.Subject = pvSubj
.Body = pvBody
.PostedDate = Now()
.SaveMessageOnSend = True
.Send 0, pvTo
End With
endit:
Set Maildb = Nothing
Set MailDoc = Nothing
Set AttachME = Nothing
Set Session = Nothing
Set EmbedObj1 = Nothing
Exit Sub
errorhandler1:
MsgBox Err.Description, , Err
Resume endit
End Sub
Please edit your question and format your code correctly – DavidPostill – 2014-09-23T10:10:47.577
I've corrected my questions can you help – Valter Canhão – 2014-09-23T12:17:18.530
What does rst![Email] look like? It seems like "SendEmail Sendto1, Esubject, strBody2" should be sending one email for each address right? – Zach – 2014-09-23T14:35:09.603
I've rst![Email] it's a text field on access I tried to put it on subject and all email's are correct. My main problem is why Lotus only pass one good email it's look's like that the second @ it's not read by Lotus. The script is to send to all email's in Sendto1 the same message. – Valter Canhão – 2014-09-23T14:42:57.863