Send mail with JMail component

How to send email with JMail via websmtp.simply.com in classic ASP.

You can use the JMail component to send emails via websmtp.simply.com.

Here is an example of how to do it.

<%
set msg = Server.CreateOBject("JMail.Message")
msg.Logging = true
msg.silent = true
msg.Charset = "UTF-8"
msg.From = "admin@xxxxx.com"
msg.FromName = "admin@xxxx.com"
msg.AddRecipient "test@ue-example.com"
msg.Subject = "Your subject"
msg.Body = "Your message"
msg.MailServerUserName = "admin@xxxx.com"
msg.MailServerPassword = "xxxxx"
 
msg.Send("websmtp.simply.com:587")

Response.write "<pre>" & msg.log & "</pre>"

%>

Article from the support category: ASP & ASP.NET