mon service info me dit pas possible d utiliser le smtp de lotus me dit qu'il faut adapter le php $ Session = new COM ("Lotus.NotesSession"); comme le fait le VBA avec Access
Je ne sait pas faire cela pour php car debutant comment adapter mon code php svp ?
voir ci-dessous code VBA à adapter est trouver l equivalence pour Php
[VB]
Private Sub Commande3_Click()
DoCmd.Hourglass True
Dim Recipient(5) As Variant 'pour deux destinataires mais tu peux faire un tableau variable
Dim Attachment(3) As Variant 'pour 3 pièces jointes mais tu peux aussi faire un tableau variable
Dim Sujet As Variant
Dim CorpsMess(5) As Variant
Dim CorpsMess2 As Variant
Dim BodyText As String
Dim SaveIt As Boolean
Dim Subject As String
Recipient(0) = Dest1
Recipient(1) = Dest2
Recipient(2) = Dest3
Recipient(3) = Dest4
Recipient(4) = Dest5
Sujet = Objet
CorpsMess(0) = Lib_1
CorpsMess(1) = Lib_2
CorpsMess(2) = Lib_3
CorpsMess(3) = Signat
CorpsMess(4) = Tel_1
CorpsMess(5) = Tel_2
Dim Maildb As Object 'The mail database
Dim UserName As String 'The current users notes name
Dim MailDbName As String 'THe current users notes mail databasename
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
'DoCmd.OutputTo acReport, "E-Mail-liste", "SnapshotFormat(*.snp)", "C:\TEMP\E-Mail-liste.snp", False, ""
DoCmd.OutputTo acReport, "E-Mail-liste", "PDFFormat(*.pdf)", "C:\TEMP\E-Mail-liste.pdf", False, ""
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 = Recipient 'Envoi à tous les destinataires
MailDoc.Subject = Sujet
MailDoc.body = CorpsMess
'MailDoc.ReturnReceipt = "1"
MailDoc.SAVEMESSAGEONSEND = SaveIt
'Set up the embedded object and attachment and attach it
Attachment(0) = "C:\TEMP\E-mail-liste.pdf"
For I = 0 To 2
If Attachment(I) <> "" Then
Set AttachME = MailDoc.CREATERICHTEXTITEM("Attachment(" & I & " )")
Set EmbedObj = AttachME.EMBEDOBJECT(1454, "", Attachment(I), "Attachment(" & I & " )")
'mailDoc.CREATERICHTEXTITEM ("Attachment(" & i & " )" )
End If
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
MsgBox "L'envoi du message par Lotus Notes a été correctement effectué!", vbExclamation, "Confirmation"
DoCmd.Hourglass False
End Sub[/VB]
mon service info me dit pas possible d utiliser le smtp de lotus me dit qu'il faut adapter le php $ Session = new COM ("Lotus.NotesSession"); comme le fait le VBA avec Access
Je ne sait pas faire cela pour php car debutant comment adapter mon code php svp ?
[quote]http://www-10.lotus.com/ldd/nd6forum.nsf/Search?SearchView&Query=email%20php%20n%3Ftes&SearchOrder=0&Start=1&Count=100[/quote]
voir ci-dessous code VBA à adapter est trouver l equivalence pour Php
[VB]
Private Sub Commande3_Click()
DoCmd.Hourglass True
Dim Recipient(5) As Variant 'pour deux destinataires mais tu peux faire un tableau variable
Dim Attachment(3) As Variant 'pour 3 pièces jointes mais tu peux aussi faire un tableau variable
Dim Sujet As Variant
Dim CorpsMess(5) As Variant
Dim CorpsMess2 As Variant
Dim BodyText As String
Dim SaveIt As Boolean
Dim Subject As String
Recipient(0) = Dest1
Recipient(1) = Dest2
Recipient(2) = Dest3
Recipient(3) = Dest4
Recipient(4) = Dest5
Sujet = Objet
CorpsMess(0) = Lib_1
CorpsMess(1) = Lib_2
CorpsMess(2) = Lib_3
CorpsMess(3) = Signat
CorpsMess(4) = Tel_1
CorpsMess(5) = Tel_2
Dim Maildb As Object 'The mail database
Dim UserName As String 'The current users notes name
Dim MailDbName As String 'THe current users notes mail databasename
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
'DoCmd.OutputTo acReport, "E-Mail-liste", "SnapshotFormat(*.snp)", "C:\TEMP\E-Mail-liste.snp", False, ""
DoCmd.OutputTo acReport, "E-Mail-liste", "PDFFormat(*.pdf)", "C:\TEMP\E-Mail-liste.pdf", False, ""
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 = Recipient 'Envoi à tous les destinataires
MailDoc.Subject = Sujet
MailDoc.body = CorpsMess
'MailDoc.ReturnReceipt = "1"
MailDoc.SAVEMESSAGEONSEND = SaveIt
'Set up the embedded object and attachment and attach it
Attachment(0) = "C:\TEMP\E-mail-liste.pdf"
For I = 0 To 2
If Attachment(I) <> "" Then
Set AttachME = MailDoc.CREATERICHTEXTITEM("Attachment(" & I & " )")
Set EmbedObj = AttachME.EMBEDOBJECT(1454, "", Attachment(I), "Attachment(" & I & " )")
'mailDoc.CREATERICHTEXTITEM ("Attachment(" & i & " )" )
End If
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
MsgBox "L'envoi du message par Lotus Notes a été correctement effectué!", vbExclamation, "Confirmation"
DoCmd.Hourglass False
End Sub[/VB]