IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

VB 6 et antérieur Discussion :

[VB6] Comment envoyer un mail HTML par Winsocks ? [Trucs & Astuces]


Sujet :

VB 6 et antérieur

  1. #1
    Membre habitué Avatar de hedgehog
    Profil pro
    Inscrit en
    Avril 2004
    Messages
    295
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2004
    Messages : 295
    Points : 133
    Points
    133
    Par défaut [VB6] Comment envoyer un mail HTML par Winsocks ?
    Salut !
    Je souhaite envoyer un mail au format html par winsocks !
    Mais la , lorsque j'envoie du code HTML , il n'est pas traduit ...

    Comment faire svp ?

    Merci

  2. #2
    Membre habitué Avatar de hedgehog
    Profil pro
    Inscrit en
    Avril 2004
    Messages
    295
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2004
    Messages : 295
    Points : 133
    Points
    133
    Par défaut
    J'ai juste besoin de savoir comment specifier que mon mail est en format HTML ...

  3. #3
    Membre habitué Avatar de hedgehog
    Profil pro
    Inscrit en
    Avril 2004
    Messages
    295
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2004
    Messages : 295
    Points : 133
    Points
    133
    Par défaut
    Ca y est , j'ai enfin trouve ...

    je vous file code meme si il y avait que deux lignes a rajouter ...
    Ca peut tjs servir :

    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
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    Private Sub mailenvoyer_Click()
    Dim tmp As String
     
    Set evt = ws
     
    ws.Connect ad, 25
    While ws.State <> sckConnected
    DoEvents
    Wend
    nextSend = False
    ws.SendData "HELO toto" & vbCrLf
    While nextSend = False
    DoEvents
    Wend
    nextSend = False
    ws.SendData "MAIL FROM:" & txtFrom.Text & vbCrLf
    While nextSend = False
    DoEvents
    Wend
    nextSend = False
    ws.SendData "RCPT TO:" & txtTo.Text & vbCrLf
    While nextSend = False
    DoEvents
    Wend
    nextSend = False
    ws.SendData "DATA" & vbCrLf
    While nextSend = False
    DoEvents
    Wend
     
    ws.SendData "To:" & txtTo.Text & vbCrLf
    ws.SendData "From:" & txtFrom.Text & vbCrLf
     
    ' -------------------------------------------------------------------------------
    ' Il suffit de spécifier cela ...
    ' A la ligne d content-type , ne le separez pas du charset car cela 
    ' ne marche pas
     
    ws.SendData "MIME-version: 1.0" & vbCrLf
    ws.SendData "Content-type: text/html; charset= iso-8859-1" & vbCrLf
     
    '--------------------------------------------------------------------------------
     
    ws.SendData "Subject:" & txtSubject.Text & vbCrLf
    ws.SendData rtxtMail.Text & vbCrLf
    nextSend = False
    ws.SendData vbCrLf & "." & vbCrLf
    While nextSend = False
    DoEvents
    Wend
     
    nextSend = False
    ws.SendData "QUIT" & vbCrLf ' Fin de l'envoi
    While nextSend = False
    DoEvents
    Wend
     
    ws.Close
    End Sub
    Voila ... Bonne prog ...

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Envoyer une page HTML par e-mail
    Par Alexandrebox dans le forum Langage
    Réponses: 6
    Dernier message: 11/03/2009, 20h33
  2. Comment envoyer un mail HTML avec Tinymce
    Par sws2008 dans le forum Langage
    Réponses: 2
    Dernier message: 06/10/2008, 18h23
  3. Comment envoyer une page web par mail
    Par zgoulanda dans le forum Débuter
    Réponses: 3
    Dernier message: 02/10/2008, 09h30
  4. [Mail] Envoyer une page html par mail
    Par Schlapp67 dans le forum Langage
    Réponses: 7
    Dernier message: 20/10/2006, 18h16

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo