La fonction ci-dessous s'utilise de la manière suivante dans
une page ASP:
<%
SendMail( "me@me.com", "dest@societe.com", "Sujet
de mon message", "Texte de mon message", cTextFormat)
%>
Const cHtmlFormat = 0
Const cTextFormat = 1
'--------------------------------------------------
' Function : SendMail( inFrom, inDest, inSub, inBody, inType)
' Parameters :
' Str inFrom sender recipient mail address
' Str Indest destination recipient mail address
' Str InSub message subject
' Str InBody message body
' Int inType message type 1=TEXT 0=HTML
' Return value :
' none
' Purpose : Send email in text or html mode using CDONTS component
' Comment :
' (c)opyright B2L-CYBER/BBDO
'--------------------------------------------------
Function SendMail( inFrom, inDest, inSub, inBody, inType)
Dim lMail
Set lMail = Server.CreateObject("CDONTS.NewMail")
lMail.From = inFrom
lMail.To = inDest
lMail.Subject = inSub
lMail.Body = inBody
lMail.BodyFormat = inType
lMail.MailFormat = inType
lMail.Send
Set lMail = Nothing
End Function
|