programming-examples/asp/More_Code_Snippets/Send an email function.asp

23 lines
502 B
Plaintext
Raw Permalink Normal View History

2019-11-18 14:25:58 +01:00
<%
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"
%>