Envoyer un email ecrivé dans un text box

cs_you Messages postés 6 Date d'inscription vendredi 22 février 2002 Statut Membre Dernière intervention 6 mai 2002 - 22 févr. 2002 à 01:52
copiercoder Messages postés 10 Date d'inscription lundi 22 avril 2002 Statut Membre Dernière intervention 8 juillet 2002 - 19 mai 2002 à 09:23
comment faire un boutton quand je clique sur ce boutton il envoyer un email à l'adresse qui est dans un textbox avec le messagerie par defaut

4 réponses

Clonk Messages postés 278 Date d'inscription mardi 22 janvier 2002 Statut Membre Dernière intervention 29 août 2006
22 févr. 2002 à 11:04
Il faut que tu utilise l'OCX Winsock
tu as pas mal de sources sur le site pour ça, il suffit d'utiliser le moteur de recherche.
0
BSide Messages postés 88 Date d'inscription mercredi 13 février 2002 Statut Membre Dernière intervention 18 février 2008
22 févr. 2002 à 14:21
Bonjour,

la question que tu as posée m'intéresse quoique je ne puisse malheureusement pas t'aider.
Pourras-tu me dire quelle solution tu as retenue quand tu auras résolu ton problème ?

Merci
0
NeoTheProgrammer Messages postés 1 Date d'inscription vendredi 22 février 2002 Statut Membre Dernière intervention 22 février 2002
22 févr. 2002 à 20:57
Voici un exemple de code qui pourra t'aider...

Il faut ajouter une reference dans ton projet : Microsoft Outlook x.0

Je l'ai essayé et ça marche tres bien... il faut que la messagerie soit ouverte...

PDest = "Titi@titi.com"
Pcopy = "Toto@toto.com"
Psubject = "Envoie d'un mail avec VB..."
PNoteText = "Bla bla bla..."
PFile = ""

'SendMessage(DisplayMsg As Boolean, PDest As String, Pcopy As String, Optional Psubject, Optional PNoteText, Optional AttachmentPath)

Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim objOutlookAttach As Outlook.Attachment

' Create the Outlook session.
Set objOutlook = CreateObject("Outlook.Application")

' Create the message.
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)

With objOutlookMsg
' Add the To recipient(s) to the message.
Set objOutlookRecip = .Recipients.Add(PDest)
objOutlookRecip.Type = olTo

If Pcopy = "" Then
Else
' Add the CC recipient(s) to the message.
Set objOutlookRecip = .Recipients.Add(Pcopy)
objOutlookRecip.Type = olCC
End If

' Add the BCC recipient(s) to the message.
' Set objOutlookRecip = .Recipients.Add("MARECHAL")
' objOutlookRecip.Type = olBCC

' Set the Subject, Body, and Importance of the message.
.Subject = "Emission Automatique : " & Psubject
.Body = PNoteText
.Importance = olImportanceHigh 'High importance

' Add attachments to the message.
'If Not IsMissing(AttachmentPath) Then
' Set objOutlookAttach = .Attachments.Add(AttachmentPath)
'End If

' Resolve each Recipient's name.
For Each objOutlookRecip In .Recipients
objOutlookRecip.Resolve
Next

' Should we display the message before sending?
If DisplayMsg Then
.Display
Else
.Send
End If
End With
Set objOutlook = Nothing
0
copiercoder Messages postés 10 Date d'inscription lundi 22 avril 2002 Statut Membre Dernière intervention 8 juillet 2002
19 mai 2002 à 09:23
j ai fait un ocx qui fait ca sous le pseudo azerty2002
0
Rejoignez-nous