xabi62
Messages postés84Date d'inscriptionjeudi 31 janvier 2002StatutMembreDernière intervention19 juillet 2006
-
24 juin 2002 à 16:33
cs_ynizon
Messages postés53Date d'inscriptionmardi 30 avril 2002StatutMembreDernière intervention19 avril 2012
-
25 juin 2002 à 12:09
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" - ...............?
cs_ynizon
Messages postés53Date d'inscriptionmardi 30 avril 2002StatutMembreDernière intervention19 avril 20121 25 juin 2002 à 12:09
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
'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