J'ai crée un pg et dedans je doit envoyer par mail avec pièce jointe et voila le code que ja' utilisé (il me supprime de destinataire et le sujet) , je ne trouve pas l'erreur? si non comment on peut utiliser winsok pour faire la meme chose?
Private Sub Cmd_EnvoiMail_Click()
Dim wTo As String
Dim wSubject As String
Dim wBody As String
Dim wAttach As String
Dim wCommandLine As String
Dim Retval As Boolean
Rem On prépare les paramètres du mail
wTo = "mhihad@yahoo.fr"
wSubject = "Essai"
wBody = "Texte du mail" & vbCrLf & "Ligne2" & vbCrLf & "Ligne 3"
wAttach = "\My documents\My Pictures\Photo.gif"
Rem On prépare la ligne de commande
wCommandLine = "-to " & Chr(34) & wTo & Chr(34)
wCommandLine = wCommandLine & " -subject " & Chr(34) & wSubject & Chr(34)
wCommandLine = wCommandLine & " -body " & Chr(34) & wBody & Chr(34)
wCommandLine = wCommandLine & " -attach " & Chr(34) & wAttach & Chr(34)
Rem On lance pmail avec sa ligne de commande
Retval = CreateProcess("tmail.exe", wCommandLine, 0, 0, 0, 0, 0, 0, 0, 0)
MsgBox "Resultat de retour: " & Retval
end sub
Merci