Envoi simple de mail avec winsock ?!

nashoy Messages postés 125 Date d'inscription dimanche 6 avril 2003 Statut Membre Dernière intervention 7 octobre 2006 - 3 déc. 2003 à 21:22
cs_EBArtSoft Messages postés 4525 Date d'inscription dimanche 29 septembre 2002 Statut Modérateur Dernière intervention 22 avril 2019 - 4 déc. 2003 à 12:12
slt,
j'ai longtemps cherché une source assez simple, juste pour envoyer un mail. Je n'ai malheureusement pas trouvé bonheur.Enfin si,il y a bc de choix,mais je pensais qu'il existait + simple. Pas grave,en cherchant j'ai un pe appris.
J'aimerai savoir pourquoi cela ne fonctionne pas :

Dim IsSend As Boolean
Dim Stat As Long

Private Sub Fermer_Click()
WS.Close
IsSend = False 
Stat = 0
End Sub

Private Sub Send_Click()If AddSend.Text "" Or Ano.Text "" Then
MsgBox "Remplis les champs", , "rempli"

 End If
Exit Sub 

IsSend = True
WS.RemoteHost = CSer.Text
WS.Close
WS.Connect Stat = 0
Listing.Clear
End Sub

Private Sub WS_Connect()
MsgBox "connecté"
End Sub

Private Sub WS_DataArrival(ByVal bytesTotal As Long)
Dim Arr As String
WS.GetData Arr

    WS.SendData "HELO " & CSer.Text & vbCrLf
    WS.SendData "MAIL FROM: <" & Ano.Text & ">" & vbCrLf

   WS.SendData "RCPT TO: <" & AddSend.Text & ">" & VbCrLf

    WS.SendData "From: <" & Ano.Text & ">" & vbCrLf
    WS.SendData "To: <" & AddSend.Text & ">" & vbCrLf
    WS.SendData "Subject: " & Obj.Text & vbCrLf & vbCrLf
    WS.SendData "DATA" & vbCrLf

    WS.SendData Mail.Text & vbCrLf & "." & vbCrLf

WS.SendData "QUIT" & vbCrLf
WS.Close
End Sub

Private Sub WS_SendComplete()
MsgBox "envoyé"
End Sub


>:) nashoy 8-)

1 réponse

cs_EBArtSoft Messages postés 4525 Date d'inscription dimanche 29 septembre 2002 Statut Modérateur Dernière intervention 22 avril 2019 9
4 déc. 2003 à 12:12
Bonjour,

Ca ne marche pas car tu n'attend pas la reponse du serveur
renseigne toi aupres de la RFC 821 (que tu peut trouver sur vbfrance dans la rubrique RFC)

@+

E.B.
0
Rejoignez-nous