bonjour,

voici mon bout de code

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
With Mail
                .From = mailUser
                .To = MEmail.Dest
                If MEmail.DestCopie.Length <> 0 Then
                    .Cc = MEmail.DestCopie
                End If
                If MEmail.DestCopieCachee.Length <> 0 Then
                    .Bcc = MEmail.DestCopieCachee
                End If
                .Subject = MEmail.Sujet
                .BodyFormat = MailFormat.Html
                If MEmail.Importance = "1" Then
                    .Priority = MailPriority.Low
                ElseIf MEmail.Importance = "2" Then
                    .Priority = MailPriority.Normal
                Else
                    .Priority = MailPriority.High
                End If
                .Body = MEmail.Message
End With
 
joint = New MailAttachment(pieceJointe, MailEncoding.Base64)
Mail.Attachments.Add(joint)
SmtpMail.SmtpServer = Constantes.ServSMTP
SmtpMail.Send(Mail)
alors voici mon pblm.
J'ai deux fichiers :

envoi-mail1.doc directement sous C:\
envoi-mail2.doc sur mon bureau (C:\Document and sesstings ....)

qd je veux envoyer envoi-mail1.doc pas de problème, mais qd je veux envoyer envoi-mail2.doc, il me met pièce jointe non valide.
Attention encore plus fort, si je fais un couper-coller de envoi-mail2.doc directement sous mon C:\ --> et bah ca marche pas non plus

Les deux fichiers sont vides.