Sent by FoxWeb Support on 05/03/2018 08:14:46 PM:
Here's the code:
<HTML>
<BODY BGCOLOR="white">
<H1>aspSmartMail : Sample 1</H1>
<HR>
<%
mySmartMail =CREATEOBJECT("aspSmartMail.SmartMail")
*SMTP Mail Server
mySmartMail.Server = "mail.yourdomain.com"
*From
mySmartMail.SenderName = "Your Name"
mySmartMail.SenderAddress = "youremail@yourdomain.com"
*To
mySmartMail.Recipients.Add("yourfriend@anydomain.com", "Friend's name")
*Message
mySmartMail.Subject = "aspSmartMail Sample 1"
mySmartMail.Body = "This mail has been sent with aspSmartMail."
* Capture send errors
SendFailed = .F.
OldErr = ON("ERROR")
ON ERROR SendFailed = .T.
*Send the message
mySmartMail.SendMail
* Reset error handler
ON ERROR &OldErr
IF SendFailed
Response.write("Failed to send e-mail. The error message was:<br>" + MESSAGE())
ELSE
Response.write("An e-mail has just been sent to " + mySmartMail.Recipients.Item(1).Name)
ENDIF
%>
</body>
</html>
FoxWeb Support Team