A voir également:
- Envois mail vb6
- Yahoo mail - Accueil - Mail
- Vb6 - Télécharger - Divers Utilitaires
- Publipostage mail - Accueil - Word
- Windows live mail - Télécharger - Mail
- Thunderbird mail - Télécharger - Mail
3 réponses
lermite222
Messages postés
8724
Date d'inscription
dimanche 8 avril 2007
Statut
Contributeur
Dernière intervention
22 janvier 2020
1 191
6 janv. 2009 à 13:22
6 janv. 2009 à 13:22
Bonjour,Voir cette discution
A+
A+
lermite222
Messages postés
8724
Date d'inscription
dimanche 8 avril 2007
Statut
Contributeur
Dernière intervention
22 janvier 2020
1 191
6 janv. 2009 à 13:48
6 janv. 2009 à 13:48
Je sais pas, j'ai pas tester..Ce que je peu dire c'est qu'avant les points tu doit ajouter l'apostrophe parce que ce sont des Rem
mailto = "to=" & TextTo.Text '........................TexTo.Text=adresse mail destinataire
mailto = "to=" & TextTo.Text '........................TexTo.Text=adresse mail destinataire
j'ai un tres gros probleme avec ce code je ne le comprend qu'a moitié donc pour le metre a ma sauce pour mon prog c'est pas facile....en plus je n'ai jamais touché au php...donc le gros probleme...je ne sais pas avec quoi edité le code php dont il parle.de plus j'ai une erreur sur cette ligne:
Shell ("c://WINDOWS/iexplore.exe " & mailreq)
mais je ne sais pas a quoi elle correspond...donc je n'arrive a rien avec ce code.
Shell ("c://WINDOWS/iexplore.exe " & mailreq)
mais je ne sais pas a quoi elle correspond...donc je n'arrive a rien avec ce code.
lermite222
Messages postés
8724
Date d'inscription
dimanche 8 avril 2007
Statut
Contributeur
Dernière intervention
22 janvier 2020
1 191
6 janv. 2009 à 14:39
6 janv. 2009 à 14:39
c'est pas du php c'est du VB6
et tu doit avoir une forme avec les textBox nommé comme dans la sub.
Mais tu est bien en VB6 ? ou sur Excel
et tu doit avoir une forme avec les textBox nommé comme dans la sub.
Mais tu est bien en VB6 ? ou sur Excel
snin j'ai trouvé ce code sur la meme discution:
[ smtp.serveur.net ]
[ monadresse@monserveur.net ]
[ destinataire@serveur.net ]
Option Explicit
'
'Déclaration de constantes
Const PourLecture = 1
Const cteAdresseSource = "monadresse@monserveur.net"
Private Sub cmd_Click(Index As Integer)
If (Index > 0) Then
' Déclaration de variables
Dim objMail As Object
Dim sDestination As String
Dim sPieceJointe As String
Dim msgTitre As String
Dim msgTexte As String
Dim Drapeau As Boolean
Set objMail = CreateObject("CDO.Message")
Drapeau = False
sDestination = "destinataire@serveur.net"
msgTitre = "Automatisme"
msgTexte = "Bonjour," & vbLf & "Corps du message"
sPieceJointe = "D:\Monfichier.txt"
Drapeau = True
With objMail
' Ligne à modifier selon l'adresse de l'envoyeur
.From = cteAdresseSource
.To = sDestination
.Subject = msgTitre
' Ligne à modifier selon le texte voulu !
If (sPieceJointe <> "") Then
If (Drapeau = True) Then
.TextBody = msgTexte & vbLf & LirePieceJointe(sPieceJointe) & vbLf
Else
.TextBody = msgTexte & vbLf & "Pièce jointe incluse : " & vbLf
End If
Else
.TextBody = msgTexte & vbCrLf & "Aucune Pièce jointe" & vbCrLf
End If
' Ligne à modifier selon l'adresse du serveur SMTP
.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.serveur.net"
.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Configuration.Fields.Update
If ((sPieceJointe <> "") And (Drapeau = False)) Then
objMail.AddAttachment (sPieceJointe)
End If
.Send
End With
Set objMail = Nothing
MsgBox "Courriel envoyé !"
Else
Unload Me
End If
End Sub
'
Function LirePieceJointe(LeFichier)
Dim objFSO, CeFichier
Set objFSO = CreateObject("Scripting.FileSystemObject")
If (objFSO.FileExists(LeFichier)) Then
Set CeFichier = objFSO.OpenTextFile(LeFichier, PourLecture)
LirePieceJointe = CeFichier.ReadAll
CeFichier.Close
Set CeFichier = Nothing
End If
Set objFSO = Nothing
End Function
Mais la aussi je ne comprend rien...
[ smtp.serveur.net ]
[ monadresse@monserveur.net ]
[ destinataire@serveur.net ]
Option Explicit
'
'Déclaration de constantes
Const PourLecture = 1
Const cteAdresseSource = "monadresse@monserveur.net"
Private Sub cmd_Click(Index As Integer)
If (Index > 0) Then
' Déclaration de variables
Dim objMail As Object
Dim sDestination As String
Dim sPieceJointe As String
Dim msgTitre As String
Dim msgTexte As String
Dim Drapeau As Boolean
Set objMail = CreateObject("CDO.Message")
Drapeau = False
sDestination = "destinataire@serveur.net"
msgTitre = "Automatisme"
msgTexte = "Bonjour," & vbLf & "Corps du message"
sPieceJointe = "D:\Monfichier.txt"
Drapeau = True
With objMail
' Ligne à modifier selon l'adresse de l'envoyeur
.From = cteAdresseSource
.To = sDestination
.Subject = msgTitre
' Ligne à modifier selon le texte voulu !
If (sPieceJointe <> "") Then
If (Drapeau = True) Then
.TextBody = msgTexte & vbLf & LirePieceJointe(sPieceJointe) & vbLf
Else
.TextBody = msgTexte & vbLf & "Pièce jointe incluse : " & vbLf
End If
Else
.TextBody = msgTexte & vbCrLf & "Aucune Pièce jointe" & vbCrLf
End If
' Ligne à modifier selon l'adresse du serveur SMTP
.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.serveur.net"
.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Configuration.Fields.Update
If ((sPieceJointe <> "") And (Drapeau = False)) Then
objMail.AddAttachment (sPieceJointe)
End If
.Send
End With
Set objMail = Nothing
MsgBox "Courriel envoyé !"
Else
Unload Me
End If
End Sub
'
Function LirePieceJointe(LeFichier)
Dim objFSO, CeFichier
Set objFSO = CreateObject("Scripting.FileSystemObject")
If (objFSO.FileExists(LeFichier)) Then
Set CeFichier = objFSO.OpenTextFile(LeFichier, PourLecture)
LirePieceJointe = CeFichier.ReadAll
CeFichier.Close
Set CeFichier = Nothing
End If
Set objFSO = Nothing
End Function
Mais la aussi je ne comprend rien...
6 janv. 2009 à 13:38
Dim mailto As String
Dim mailfrom As String
Dim mailtitre As String
Dim mailcorps As String
Dim mailreq As String
Sub envoyer()
mailto = "to=" & TextTo.Text........................TexTo.Text=adresse mail destinataire
mailfrom = "from=From:" & TextFrom.Text.......TextFrom.Text=mon adresse mail
mailtitre = "titre=" & TextTitre.Text................TextTitre.Text=titre du mail ou objet
mailcorps = Replace(TextCorps.Text, Chr$(10), "\n".........=position le text au bonne endroit
mailcorps = "corps=" & mailcorps.......................=text en lui meme
mailreq = "http://domaine.tld/vbmail.php?" & mailto & "&" & mailfrom & "&" & mailtitre & "&" & mailcorps
Shell ("c://WINDOWS/iexplore.exe " & mailreq)
End Sub