Send an email function

<%
Function SendMail(mTo , mFrom , mSubject , mBody)
Set objCdonts = Server.CreateObject("CDONTS.NewMail")
objCdonts.To = mTo
objCdonts.From = mFrom
objCdonts.Subject = mSubject
objCdonts.Body = mBody
objCdonts.Send
Set objCdonts = Nothing
If Err Then
SendMail = False
Else
SendMail = True
End If
End Function
%>

and to call the function we can use something like this

<%
SendMail "youremail@email.com" , "myemail@email.com" , "testing" , "testing again"
%>

 

Sponsors

cover

Professional Active Server Pages 3.0

cover

Beginning ASP Databases

cover

ASP in a Nutshell: A Desktop Quick...