Probleme d'envoi d' email Notes en Copie

dckiller

XLDnaute Nouveau
Bonjour à tous,

J'arrive à envoyer par mail une pièces jointes au destinataire principale et au premier destinataire en copie mais les autres mail en copie ne s'envoi pas. Ce qui est bizarre dans mon récap Notes envoyer, les destinataires apparaissent bien sur la ligne CC.

Voici la macro que j'utilise.

Merci de votre aide.

Sub Envoi()
Dim Sujet As String, Corps As String, Desti As String
Dim CC As String, c As Range, PJ As String
Sujet = "TEST"
Corps = "Bonjour," & Chr(13) & "TEST"
CC = "Destinataire2@excel.fr, Destinataire3@excel.fr, Destinataire4@excel.fr"
Desti = "Destinataire1@excel.fr"
PJ = "D:\MONFICHIERPERSO.xls"
SendNotesMail Sujet, Corps, Desti, CC, PJ
End Sub

Public Sub SendNotesMail(Sujet, Corps, Desti, CC, PJ)
'Set up the objects required for Automation into lotus notes
Dim Maildb As Object 'The mail database
Dim UserName As String 'The current users notes name
Dim Corps_Msg As String ' text du courriel
Dim MailDbName As String 'THe current users notes mail database name
Dim MailDoc As Object 'The mail document itself
Dim AttachME As Object 'The attachment richtextfile object
Dim Session As Object 'The notes session
Dim EmbedObj As Object 'The embedded object (Attachment)
'Start a session to notes
Set Session = CreateObject("Notes.NotesSession")
'Next line only works with 5.x and above. Replace password with your Password
' Session.Initialize ("password" )
'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 or using above password you can use other mailboxes.
''MailDbName = Left$(UserName, 1) & Right$(UserName, (Len(UserName) - InStr(1, UserName, " "))) & ".nsf"
''UserName = Session.UserName

''SearchString = Recipient
''SearchChar = "@"
''MyPos = InStr(1, SearchString, SearchChar, vbTextCompare)
''Destinataire = Left(SearchString, MyPos - 1)
'Open the mail database in notes
Set Maildb = Session.GETDATABASE("", "")
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 = Desti
MailDoc.Subject = Sujet
MailDoc.copyto = CC
'MailDoc.Body = Corps
Set MailCorps = MailDoc.CREATERICHTEXTITEM("Body")

With MailCorps
.ADDNEWLINE 1
.APPENDTEXT Corps
.ADDNEWLINE 2
End With

MailDoc.SAVEMESSAGEONSEND = True
'Set up the embedded object and attachment and attach it
Set AttachME = MailDoc.CREATERICHTEXTITEM("D:\MONFICHIERPERSO.xls")
'AttachME.AppendText "toto"
Call AttachME.EMBEDOBJECT(1454, "", "D:\MONFICHIERPERSO.xls")

'Send the document
MailDoc.PostedDate = Now() 'Gets the mail to appear in the sent items folder
MailDoc.Send 0
'Clean Up
Set Maildb = Nothing
Set MailDoc = Nothing
Set AttachME = Nothing
Set Session = Nothing
Set EmbedObj = Nothing

End Sub
 

Hulk

XLDnaute Barbatruc
Re : Probleme d'envoi d' email Notes en Copie

Hello,

Sans garantie, essaie de rempacer cette ligne de code
Code:
CC = "Destinataire2@excel.fr[COLOR="Green"][B];[/B][/COLOR] Destinataire3@excel.fr[COLOR="green"][B];[/B][/COLOR] Destinataire4@excel.fr"
Donc, remplacer les virgules par des point-virgules !

Cdt, Hulk.
 

Discussions similaires

Réponses
6
Affichages
360

Membres actuellement en ligne

Statistiques des forums

Discussions
312 611
Messages
2 090 226
Membres
104 452
dernier inscrit
hamzamounir