Comment envoyer un mail....????

Signaler
Messages postés
84
Date d'inscription
jeudi 31 janvier 2002
Statut
Membre
Dernière intervention
19 juillet 2006
-
Messages postés
53
Date d'inscription
mardi 30 avril 2002
Statut
Membre
Dernière intervention
19 avril 2012
-
Comment faire pour envoyer un mail sans utiliser la commande suivante :
- Shell "C:Program Files\Outlook Express\msimn.exe /mailurl:mailto:xabi62@yahoo.fr?subject=Hello" - ...............?

A+

XaV

1 réponse

Messages postés
53
Date d'inscription
mardi 30 avril 2002
Statut
Membre
Dernière intervention
19 avril 2012
1
Private Function EmailCreate(sTmpFile) As Long

Dim hFile As Long

hFile = FreeFile
Open sTmpFile For Output As #hFile

EmailCreate = hFile

End Function

Public Function EcrireEmail_OutlookExpress(MsgFrom As String, MsgTo As String, MsgCC As String, MsgBCC As String, MsgSubject As String, MsgPriority As Integer, MsgMessage As String) As Boolean

Dim sTmpFile As String
'the temp email file
sTmpFile = App.Path & "\temp.eml"
Dim hFile As Long
hFile = EmailCreate(sTmpFile)

'if successful,
If hFile <> 0 Then

'write the email fields to the file

Print #hFile, "From: <"; MsgFrom; ">"

If Len(MsgTo) Then
Print #hFile, "To: "; Chr$(34); MsgTo; Chr$(34)
Else
'no to address, so bail
EcrireEmail_OutlookExpress = False
Exit Function
End If

If Len(MsgCC) Then
Print #hFile, "CC: "; Chr$(34); MsgCC; Chr$(34)
End If

If Len(MsgBCC) Then
Print #hFile, "BCC: "; Chr$(34); MsgBCC; Chr$(34)
End If

Print #hFile, "Subject: "; MsgSubject
Print #hFile, "X-Priority:"; MsgPriority '1=high,3=normal,5=low

'this is the last header line - everything
'after this appears in the message.
Print #hFile, "X-Unsent: 1"
Print #hFile, "" 'Blank line
Print #hFile, MsgMessage

Close #hFile

EcrireEmail_OutlookExpress = True

RunShellExecute "Open", sTmpFile, vbNullString, vbNullString, vbNormalFocus
End If
End Function
0