Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

Bis mail

13 réponses
Avatar
IMER09
Bonjour a tous

Suite a mes precedents messages:
Comment pourrais je faire pour avoir une confirmation d'envoi de ma feuil
par mail
Le mail ainsi envoyé par excel ne s'ajoute pas ds mes messages envoyer et je
n'arrive pas a cocher la case "confirmation de lecture"

Merci

Rémi

3 réponses

1 2
Avatar
IMER09
Merci michdenis désolé pour le retard de ma reponse
Mon SMTP est wanadoo.fr
Je ne sais pas si certain de mes destinataires on une confirmation de
lecture, je ne les ai pas encore questionné
J'en ai un que j'ai pu verifier
Il utilise wanadoo, il n'a pas de confirmation de lecture
Toujours est il que j'ai maintenant une trace de l'envoi facilement
verifiable grace au petit bout de code de la fin

Merci de nouveau

Ci apres ton code adapté a mon besoin, je pense ne pas avoir fait d'erreur
mais !!!

Sub Message

If Range("AL7") <> "1" Then
If Range("AL7") <> "0" Then
Dim W As Range
For Each W In Range("AK7")
Range("A1").Select

Sheets("DAC").Activate
Range("A1:O44").Copy
Workbooks.Add

ActiveSheet.Paste
Application.DisplayAlerts = False

If Application.Version = "12.0" Then
ActiveSheet.SaveAs "BasculeSharedDocsD.A.C.xls", FileFormat:=xlExcel8
Else
ActiveSheet.SaveAs "BasculeSharedDocsD.A.C.xls"
End If
' ActiveSheet.SaveAs "BasculeSharedDocsD.A.C.xls" ',
FileFormat:=xlTextWindows

ActiveWorkbook.Close SaveChanges:=True
Application.DisplayAlerts = True


Dim TonSmtp As String
Dim Expéditeur As String
Dim Destinataire As String
Dim iMsg As Object
Dim iConf As Object
Dim cell As Range
'Dim Flds As Variant


'********************************************
'Variable à définir :
TonSmtp = "Smtp.wanadoo.fr"
Destinataire = W.Value
Expéditeur = ""
'********************************************

Application.ScreenUpdating = False
Set iConf = CreateObject("CDO.Configuration")
iConf.Load -1
Set Flds = iConf.fields

With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
TonSmtp
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") =
25
.Update
End With

strbody = "Bonjour" & vbNewLine & vbNewLine & _
"ci joint" & vbNewLine & _
"DAC du dernier camion" & vbNewLine & _
"Pouvez vous faire le necessaire" & vbNewLine & vbNewLine & _
"Salutations" & vbNewLine & vbNewLine & _
"toto"

Set iMsg = CreateObject("CDO.Message")
With iMsg
Set .Configuration = iConf
.To = Destinataire
.From = Expéditeur
.Subject = "DAC"
.TextBody = strbody
.AddAttachment "BasculeSharedDocsD.A.C.xls"
' Set importance high, will work if the receiver have Outlook
.fields("urn:schemas:httpmail:importance") = 2
' Set Priority high, will work if the receiver have Outlook Express
.fields("urn:schemas:mailheader:X-Priority") = 1
'If you want to add a request read receipt then you can use this.
'Note: this is only working if the receiver have Outlook Express.
' Request read receipt if the receiver have Outlook Express
.fields("urn:schemas:mailheader:return-receipt-to") = Expéditeur
.fields.Update
.Send
End With

'écrire l'envoi de ton courriel dans un fichier texte
Texte = Now & ";"
Texte = Texte & "N°" & Range("K5").Value & " " & Range("K7").Value & ";"
Texte = Texte & Destinataire & ";"
Texte = Texte & "DAC " 'iMsg.Subject

Num = FreeFile
'À définir le chemin et le nom du fichier...
Fichier = "BasculeSharedDocsEmail.txt"

Open Fichier For Append As #Num
Print #Num, Texte
Close #Num

Set iMsg = Nothing
Set iConf = Nothing

Application.ScreenUpdating = True

Next W
End If
End If

If Range("AL7") = "1" Then
MsgBox "Pas d'Imail definit pour cet acheteur !", vbExclamation, _
"ERREUR ... !"
End If
End Sub

Rémi

"michdenis" a écrit dans le message de news:

Même si tu n'utilises pas Outlook Express ou Microsoft Express,
tu dois définir le SMTP .... dans la configuration internet pour
te servir de la procédure !

Tu peux utiliser un fichier texte pour enregistrer tous les envois
que tu fais. comme ceci :
J'ai ajouté quelques lignes de code à cet effet à la fin de la
présente procédure.

'---------------------------------------------------------
Sub Message()
Dim TonSmtp As String
Dim Expéditeur As String
Dim Destinataire As String
Dim iMsg As Object
Dim iConf As Object
Dim cell As Range
'Dim Flds As Variant


'********************************************
'Variable à définir :
TonSmtp = "Smtp........"
Destinataire = "....."
Expéditeur = "........"
'********************************************

Application.ScreenUpdating = False
Set iConf = CreateObject("CDO.Configuration")
iConf.Load -1
Set Flds = iConf.fields

With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
TonSmtp
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport")
= 25
.Update
End With

Set iMsg = CreateObject("CDO.Message")
With iMsg
Set .Configuration = iConf
.To = Destinataire
.From = Expéditeur
.Subject = "Un test"
.TextBody = "Ok ça marche"
' Set importance high, will work if the receiver have Outlook
.fields("urn:schemas:httpmail:importance") = 2
' Set Priority high, will work if the receiver have Outlook Express
.fields("urn:schemas:mailheader:X-Priority") = 1
'If you want to add a request read receipt then you can use this.
'Note: this is only working if the receiver have Outlook Express.
' Request read receipt if the receiver have Outlook Express
.fields("urn:schemas:mailheader:return-receipt-to") = Expéditeur
.fields.Update
.Send
End With

'écrire l'envoi de ton courriel dans un fichier texte
Texte = Now & ";"
Texte = Texte & Expéditeur & ";"
Texte = Texte & Destinataire & ";"
Texte = Texte & iMsg.Subject

Num = FreeFile
'À définir le chemin et le nom du fichier...
Fichier = "C:UsersPowerUsertest.csv"

Open Fichier For Append As #Num
Print #Num, Texte
Close #Num

Set iMsg = Nothing
Set iConf = Nothing
Application.ScreenUpdating = True
End Sub
'---------------------------------------------------------



"IMER09" a écrit dans le message de
groupe de
discussion : #
Merci a vous 2
Je viens de tester, je n'ai tjrs pas de confirmation de lecture.
Le message est bien envoyé mais rien n'oblige le destinataire a confirmer
la
lecture

J'ai un peu de difficulte avec ca:
' Set importance high, will work if the receiver have Outlook
.fields("urn:schemas:httpmail:importance") = 2
' Set Priority high, will work if the receiver have Outlook Express
.fields("urn:schemas:mailheader:X-Priority") = 1
'If you want to add a request read receipt then you can use this.
'Note: this is only working if the receiver have Outlook Express.
' Request read receipt if the receiver have Outlook Express
.fields("urn:schemas:mailheader:return-receipt-to") = Expéditeur

je n'utilise ni outlook ni outlook express
je suis ds le brouillard, ca devient complexe pour ma petite tete

en tout cas c'est sympa de vous occuper de moi, merci

Rémi

"michdenis" a écrit dans le message de news:

Tu peux demander à ton destinataire, une confirmation comme ceci

Si tu utilises le service Microsoft Outlook, je "pense" que tes
courriels sortants sont enregistrés mais pas avec Outlook express.

'---------------------------------------------------------
Sub Message()
Dim TonSmtp As String
Dim Expéditeur As String
Dim Destinataire As String
Dim iMsg As Object
Dim iConf As Object
Dim cell As Range
'Dim Flds As Variant


'********************************************
'Variable à définir :
TonSmtp = "Smtp........"
Destinataire = "....."
Expéditeur = "........"
'********************************************

Application.ScreenUpdating = False
Set iConf = CreateObject("CDO.Configuration")
iConf.Load -1
Set Flds = iConf.fields

With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") >> TonSmtp
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport")
= 25
.Update
End With

Set iMsg = CreateObject("CDO.Message")
With iMsg
Set .Configuration = iConf
.To = Destinataire
.From = Expéditeur
.Subject = "Un test"
.TextBody = "Ok ça marche"
' Set importance high, will work if the receiver have Outlook
.fields("urn:schemas:httpmail:importance") = 2
' Set Priority high, will work if the receiver have Outlook Express
.fields("urn:schemas:mailheader:X-Priority") = 1
'If you want to add a request read receipt then you can use this.
'Note: this is only working if the receiver have Outlook Express.
' Request read receipt if the receiver have Outlook Express
.fields("urn:schemas:mailheader:return-receipt-to") = Expéditeur
.fields.Update
.Send
End With
Set iMsg = Nothing
Set iConf = Nothing
Application.ScreenUpdating = True
End Sub
'---------------------------------------------------------
















Avatar
michdenis
L'exemple que je te proposais, te retournais si le destinataire
le voulais bien, un accusé de réception... c'est toi qui aurait
du recevoir cet accusé de réception et non un quelconque
destinataire à moins d'avoir indiqué son adresse
là :
.fields("urn:schemas:mailheader:return-receipt-to") = son _Adresse

Tant mieux si tu as trouvé une procédure qui réponde à tes besoins.


"IMER09" a écrit dans le message de groupe de
discussion :
Merci michdenis désolé pour le retard de ma reponse
Mon SMTP est wanadoo.fr
Je ne sais pas si certain de mes destinataires on une confirmation de
lecture, je ne les ai pas encore questionné
J'en ai un que j'ai pu verifier
Il utilise wanadoo, il n'a pas de confirmation de lecture
Toujours est il que j'ai maintenant une trace de l'envoi facilement
verifiable grace au petit bout de code de la fin

Merci de nouveau

Ci apres ton code adapté a mon besoin, je pense ne pas avoir fait d'erreur
mais !!!

Sub Message

If Range("AL7") <> "1" Then
If Range("AL7") <> "0" Then
Dim W As Range
For Each W In Range("AK7")
Range("A1").Select

Sheets("DAC").Activate
Range("A1:O44").Copy
Workbooks.Add

ActiveSheet.Paste
Application.DisplayAlerts = False

If Application.Version = "12.0" Then
ActiveSheet.SaveAs "BasculeSharedDocsD.A.C.xls", FileFormat:=xlExcel8
Else
ActiveSheet.SaveAs "BasculeSharedDocsD.A.C.xls"
End If
' ActiveSheet.SaveAs "BasculeSharedDocsD.A.C.xls" ',
FileFormat:=xlTextWindows

ActiveWorkbook.Close SaveChanges:=True
Application.DisplayAlerts = True


Dim TonSmtp As String
Dim Expéditeur As String
Dim Destinataire As String
Dim iMsg As Object
Dim iConf As Object
Dim cell As Range
'Dim Flds As Variant


'********************************************
'Variable à définir :
TonSmtp = "Smtp.wanadoo.fr"
Destinataire = W.Value
Expéditeur = ""
'********************************************

Application.ScreenUpdating = False
Set iConf = CreateObject("CDO.Configuration")
iConf.Load -1
Set Flds = iConf.fields

With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") TonSmtp
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") 25
.Update
End With

strbody = "Bonjour" & vbNewLine & vbNewLine & _
"ci joint" & vbNewLine & _
"DAC du dernier camion" & vbNewLine & _
"Pouvez vous faire le necessaire" & vbNewLine & vbNewLine & _
"Salutations" & vbNewLine & vbNewLine & _
"toto"

Set iMsg = CreateObject("CDO.Message")
With iMsg
Set .Configuration = iConf
.To = Destinataire
.From = Expéditeur
.Subject = "DAC"
.TextBody = strbody
.AddAttachment "BasculeSharedDocsD.A.C.xls"
' Set importance high, will work if the receiver have Outlook
.fields("urn:schemas:httpmail:importance") = 2
' Set Priority high, will work if the receiver have Outlook Express
.fields("urn:schemas:mailheader:X-Priority") = 1
'If you want to add a request read receipt then you can use this.
'Note: this is only working if the receiver have Outlook Express.
' Request read receipt if the receiver have Outlook Express
.fields("urn:schemas:mailheader:return-receipt-to") = Expéditeur
.fields.Update
.Send
End With

'écrire l'envoi de ton courriel dans un fichier texte
Texte = Now & ";"
Texte = Texte & "N°" & Range("K5").Value & " " & Range("K7").Value & ";"
Texte = Texte & Destinataire & ";"
Texte = Texte & "DAC " 'iMsg.Subject

Num = FreeFile
'À définir le chemin et le nom du fichier...
Fichier = "BasculeSharedDocsEmail.txt"

Open Fichier For Append As #Num
Print #Num, Texte
Close #Num

Set iMsg = Nothing
Set iConf = Nothing

Application.ScreenUpdating = True

Next W
End If
End If

If Range("AL7") = "1" Then
MsgBox "Pas d'Imail definit pour cet acheteur !", vbExclamation, _
"ERREUR ... !"
End If
End Sub

Rémi

"michdenis" a écrit dans le message de news:

Même si tu n'utilises pas Outlook Express ou Microsoft Express,
tu dois définir le SMTP .... dans la configuration internet pour
te servir de la procédure !

Tu peux utiliser un fichier texte pour enregistrer tous les envois
que tu fais. comme ceci :
J'ai ajouté quelques lignes de code à cet effet à la fin de la
présente procédure.

'---------------------------------------------------------
Sub Message()
Dim TonSmtp As String
Dim Expéditeur As String
Dim Destinataire As String
Dim iMsg As Object
Dim iConf As Object
Dim cell As Range
'Dim Flds As Variant


'********************************************
'Variable à définir :
TonSmtp = "Smtp........"
Destinataire = "....."
Expéditeur = "........"
'********************************************

Application.ScreenUpdating = False
Set iConf = CreateObject("CDO.Configuration")
iConf.Load -1
Set Flds = iConf.fields

With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") > TonSmtp
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport")
= 25
.Update
End With

Set iMsg = CreateObject("CDO.Message")
With iMsg
Set .Configuration = iConf
.To = Destinataire
.From = Expéditeur
.Subject = "Un test"
.TextBody = "Ok ça marche"
' Set importance high, will work if the receiver have Outlook
.fields("urn:schemas:httpmail:importance") = 2
' Set Priority high, will work if the receiver have Outlook Express
.fields("urn:schemas:mailheader:X-Priority") = 1
'If you want to add a request read receipt then you can use this.
'Note: this is only working if the receiver have Outlook Express.
' Request read receipt if the receiver have Outlook Express
.fields("urn:schemas:mailheader:return-receipt-to") = Expéditeur
.fields.Update
.Send
End With

'écrire l'envoi de ton courriel dans un fichier texte
Texte = Now & ";"
Texte = Texte & Expéditeur & ";"
Texte = Texte & Destinataire & ";"
Texte = Texte & iMsg.Subject

Num = FreeFile
'À définir le chemin et le nom du fichier...
Fichier = "C:UsersPowerUsertest.csv"

Open Fichier For Append As #Num
Print #Num, Texte
Close #Num

Set iMsg = Nothing
Set iConf = Nothing
Application.ScreenUpdating = True
End Sub
'---------------------------------------------------------



"IMER09" a écrit dans le message de
groupe de
discussion : #
Merci a vous 2
Je viens de tester, je n'ai tjrs pas de confirmation de lecture.
Le message est bien envoyé mais rien n'oblige le destinataire a confirmer
la
lecture

J'ai un peu de difficulte avec ca:
' Set importance high, will work if the receiver have Outlook
.fields("urn:schemas:httpmail:importance") = 2
' Set Priority high, will work if the receiver have Outlook Express
.fields("urn:schemas:mailheader:X-Priority") = 1
'If you want to add a request read receipt then you can use this.
'Note: this is only working if the receiver have Outlook Express.
' Request read receipt if the receiver have Outlook Express
.fields("urn:schemas:mailheader:return-receipt-to") = Expéditeur

je n'utilise ni outlook ni outlook express
je suis ds le brouillard, ca devient complexe pour ma petite tete

en tout cas c'est sympa de vous occuper de moi, merci

Rémi

"michdenis" a écrit dans le message de news:

Tu peux demander à ton destinataire, une confirmation comme ceci

Si tu utilises le service Microsoft Outlook, je "pense" que tes
courriels sortants sont enregistrés mais pas avec Outlook express.

'---------------------------------------------------------
Sub Message()
Dim TonSmtp As String
Dim Expéditeur As String
Dim Destinataire As String
Dim iMsg As Object
Dim iConf As Object
Dim cell As Range
'Dim Flds As Variant


'********************************************
'Variable à définir :
TonSmtp = "Smtp........"
Destinataire = "....."
Expéditeur = "........"
'********************************************

Application.ScreenUpdating = False
Set iConf = CreateObject("CDO.Configuration")
iConf.Load -1
Set Flds = iConf.fields

With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") >> TonSmtp
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport")
= 25
.Update
End With

Set iMsg = CreateObject("CDO.Message")
With iMsg
Set .Configuration = iConf
.To = Destinataire
.From = Expéditeur
.Subject = "Un test"
.TextBody = "Ok ça marche"
' Set importance high, will work if the receiver have Outlook
.fields("urn:schemas:httpmail:importance") = 2
' Set Priority high, will work if the receiver have Outlook Express
.fields("urn:schemas:mailheader:X-Priority") = 1
'If you want to add a request read receipt then you can use this.
'Note: this is only working if the receiver have Outlook Express.
' Request read receipt if the receiver have Outlook Express
.fields("urn:schemas:mailheader:return-receipt-to") = Expéditeur
.fields.Update
.Send
End With
Set iMsg = Nothing
Set iConf = Nothing
Application.ScreenUpdating = True
End Sub
'---------------------------------------------------------
















Avatar
IMER09
Excuse moi je me suis peut etre mal expliqué j'ai bien compris que c'etait
moi qui devait recevoir l'accusé de reception si le destinataire voulait
bien y repondre

Je n'ai pu verifier, pour l'intant, que chez un de mes destinataires si
lors de l'ouverture de mon message il avait une boite de dialogue l'invitant
a me signaler si il avait lu mon mail.
Ce n'etait malheureusement pas le cas (il utilise wanadoo)

j'ai bien indiqué là:
.fields("urn:schemas:mailheader:return-receipt-to") = Expéditeur
Expéditeur = ""
"" est mon adresse

Rémi

"michdenis" a écrit dans le message de news:

L'exemple que je te proposais, te retournais si le destinataire
le voulais bien, un accusé de réception... c'est toi qui aurait
du recevoir cet accusé de réception et non un quelconque
destinataire à moins d'avoir indiqué son adresse
là :
.fields("urn:schemas:mailheader:return-receipt-to") = son _Adresse

Tant mieux si tu as trouvé une procédure qui réponde à tes besoins.


1 2