Hi !

I would like to send mail via lotus notes with access.
All work well !
now, I would improve my code by adding a sign sent mail :
How do I do ?

here is the piece of code :

thanks!
A french.

Dim Maildb As Object 'The mail database
Dim UserName As String 'The crrent users notes name
Dim MailDbName As String 'THe ul document itself
Dim AttachME As Object 'The atcurrent users notes mail database name
Dim MailDoc As Object 'The maitachment richtextfile object
Dim Session As Object 'The notes session
Dim EmbedObj As Object 'The embedded object (Attachment)
Dim i As Integer


'Start a session to notes
Set Session = CreateObject("Notes.NotesSession")
'Get the sessions username and then calculate the mail file name
'You may or may not need this as for MailDBname with some systems you
'can pass an empty string
UserName = Session.UserName
MailDbName = Left$(UserName, 1) & Right$(UserName, (Len(UserName) - InStr(1, UserName, " "))) & ".nsf"
'Open the mail database in notes
Set Maildb = Session.GETDATABASE("", MailDbName)
If Maildb.ISOPEN = True Then
'Already open for mail
Else
Maildb.OPENMAIL
End If
'Set up the new mail document
Set MailDoc = Maildb.CreateDocument
MailDoc.Form = "Memo"
MailDoc.SendTo = "toto@titi.fr
MailDoc.Subject = "the subject"
MailDoc.Body = "the body text"
MailDoc.SAVEMESSAGEONSEND = SaveIt
'Set up the embedded object and attachment and attach it
Set AttachME = Nothing
Set EmbedObj = Nothing
Set AttachME = MailDoc.CREATERICHTEXTITEM("Attachment")
For i = 0 To Nbr - 1
Set EmbedObj = AttachME.EMBEDOBJECT(1454, "", attachment(0)(i), "Attachment")
Next i
'Send the document
MailDoc.PostedDate = Now() 'Gets the mail to appear in the sent items folder
MailDoc.send 0, recipient
'Clean Up
Set Maildb = Nothing
Set MailDoc = Nothing
Set AttachME = Nothing
Set Session = Nothing
Set EmbedObj = Nothing