Disparition destinataire VB\mail\lotus\.INI
soyanlo
Messages postés
14
Date d'inscription
Statut
Membre
Dernière intervention
-
soyanlo Messages postés 14 Date d'inscription Statut Membre Dernière intervention -
soyanlo Messages postés 14 Date d'inscription Statut Membre Dernière intervention -
Bonjour,
J'ai un problème d'envois de mail dans mon application VB, voici le code d'envoi :
Public Sub Envoyer()
Dim oSess As Object
Dim oDB As Object
Dim oDoc As Object
Dim oItem As Object
Dim flag As Boolean
Dim datedujour As String
datedujour = Format(Now, "dd-MM-yyyy")
oSess = CreateObject("Notes.NotesSession")
oDB = oSess.GETDATABASE("", "")
Call oDB.OPENMAIL()
flag = True
If Not (oDB.ISOPEN) Then flag = oDB.OPEN("", "")
If Not flag Then
MsgBox("Can't open mail file: " & oDB.SERVER & " " & oDB.FILEPATH)
GoTo exit_SendAttachment
End If
On Error GoTo err_handler
'Building Message
oDoc = oDB.CREATEDOCUMENT
oItem = oDoc.CREATERICHTEXTITEM("BODY")
oDoc.Form = INI_GetCle(Application.StartupPath & "\Declaration.ini", "mail", "form")
oDoc.subject = INI_GetCle(Application.StartupPath & "\Declaration.ini", "mail", "subject")
oDoc.sendto = INI_GetCle(Application.StartupPath & "\Declaration.ini", "mail", "sendto")
oDoc.copyto = INI_GetCle(Application.StartupPath & "\Declaration.ini", "mail", "copyto")
oDoc.body = INI_GetCle(Application.StartupPath & "\Declaration.ini", "mail", "body")
oDoc.postdate = datedujour
'Attaching DATABASE
Call oItem.EmbedObject(1454, "", "D:\projet\Formulaire_" & datedujour & ".xls")
oDoc.visable = True
'Sending Message
oDoc.SEND(False)
exit_SendAttachment:
On Error Resume Next
oSess = Nothing
oDB = Nothing
oDoc = Nothing
oItem = Nothing
'Done
Exit Sub
err_handler:
If Err.Number = 7225 Then
MsgBox("File doesn't exist")
Else
MsgBox(Err.Number & " " & Err.Description)
End If
On Error GoTo exit_SendAttachment
End Sub
Et voici le fichier .ini :
[mail]
Form = Memo
subject = Déclaration de sinistre
sendto = toto.tata@test.fr
copyto = toto.tata@test.fr ; toto.tata@test.fr ; toto.tata@test.fr
body = Vous trouverez ci-join un fichier de déclaration de sinistre
Au lieu de recevoir 4 mail j'en reçois que 2 :
lorsque je reçois le premier message j'ai bien correctement les destinataires d'affichés
1 desti et 3 copy
Par contre, sur le 2ème mail:
le destinataire est OK
Mais les copies j'ai : toto.tata@test.fr ; toto.tata
Donc la 3eme adresse a été coupée, et la 4eme complétement disparue...
Avez vous une idée ?
Et un autre problème se pose :
J'utilise aussi le .ini pour rechercher le chemin d'accès à un fichier :
[fichier]
source = D:\projet\Formulaire.xls
copie = D:\projet\Formulaire_" & datedujour & ".xls
que je récupère comme ceci
Val(INI_GetCle(Application.StartupPath & "\Declaration.ini", "fichier", "copie"))
Pas de soucis avec la "source" mais ça ne marche pas avec la copie
Merci de votre aide
J'ai un problème d'envois de mail dans mon application VB, voici le code d'envoi :
Public Sub Envoyer()
Dim oSess As Object
Dim oDB As Object
Dim oDoc As Object
Dim oItem As Object
Dim flag As Boolean
Dim datedujour As String
datedujour = Format(Now, "dd-MM-yyyy")
oSess = CreateObject("Notes.NotesSession")
oDB = oSess.GETDATABASE("", "")
Call oDB.OPENMAIL()
flag = True
If Not (oDB.ISOPEN) Then flag = oDB.OPEN("", "")
If Not flag Then
MsgBox("Can't open mail file: " & oDB.SERVER & " " & oDB.FILEPATH)
GoTo exit_SendAttachment
End If
On Error GoTo err_handler
'Building Message
oDoc = oDB.CREATEDOCUMENT
oItem = oDoc.CREATERICHTEXTITEM("BODY")
oDoc.Form = INI_GetCle(Application.StartupPath & "\Declaration.ini", "mail", "form")
oDoc.subject = INI_GetCle(Application.StartupPath & "\Declaration.ini", "mail", "subject")
oDoc.sendto = INI_GetCle(Application.StartupPath & "\Declaration.ini", "mail", "sendto")
oDoc.copyto = INI_GetCle(Application.StartupPath & "\Declaration.ini", "mail", "copyto")
oDoc.body = INI_GetCle(Application.StartupPath & "\Declaration.ini", "mail", "body")
oDoc.postdate = datedujour
'Attaching DATABASE
Call oItem.EmbedObject(1454, "", "D:\projet\Formulaire_" & datedujour & ".xls")
oDoc.visable = True
'Sending Message
oDoc.SEND(False)
exit_SendAttachment:
On Error Resume Next
oSess = Nothing
oDB = Nothing
oDoc = Nothing
oItem = Nothing
'Done
Exit Sub
err_handler:
If Err.Number = 7225 Then
MsgBox("File doesn't exist")
Else
MsgBox(Err.Number & " " & Err.Description)
End If
On Error GoTo exit_SendAttachment
End Sub
Et voici le fichier .ini :
[mail]
Form = Memo
subject = Déclaration de sinistre
sendto = toto.tata@test.fr
copyto = toto.tata@test.fr ; toto.tata@test.fr ; toto.tata@test.fr
body = Vous trouverez ci-join un fichier de déclaration de sinistre
Au lieu de recevoir 4 mail j'en reçois que 2 :
lorsque je reçois le premier message j'ai bien correctement les destinataires d'affichés
1 desti et 3 copy
Par contre, sur le 2ème mail:
le destinataire est OK
Mais les copies j'ai : toto.tata@test.fr ; toto.tata
Donc la 3eme adresse a été coupée, et la 4eme complétement disparue...
Avez vous une idée ?
Et un autre problème se pose :
J'utilise aussi le .ini pour rechercher le chemin d'accès à un fichier :
[fichier]
source = D:\projet\Formulaire.xls
copie = D:\projet\Formulaire_" & datedujour & ".xls
que je récupère comme ceci
Val(INI_GetCle(Application.StartupPath & "\Declaration.ini", "fichier", "copie"))
Pas de soucis avec la "source" mais ça ne marche pas avec la copie
Merci de votre aide
A voir également:
- Disparition destinataire VB\mail\lotus\.INI
- Publipostage mail - Accueil - Word
- Windows live mail - Télécharger - Mail
- Vb - Télécharger - Langages
- Lotus organizer - Télécharger - Organisation
- Créer une adresse mail hotmail - Guide