Jmail Pro Is Installed On All Servers.

Send Email from ASP using JMail

JMail is a popular COM component used to send email from classic ASP pages. It provides a simple way to integrate email functionality into your website. Below you’ll find a sample script and important notes on configuration.

Sample JMail Code

<%
Set JMail = Server.CreateObject("JMail.Message")
JMail.Logging = true
JMail.Charset = "ISO-8859-1"

' Sender and recipient details
JMail.From = "me@mydomain.com"
JMail.FromName = "My Website"
JMail.AddRecipient "recipient@test.com"

' Message content
JMail.Subject = "Example JMail Message"
JMail.Body = "This is a sample message sent using JMail."

' SMTP server configuration
JMail.MailServerUserName = "me@mydomain.com"
JMail.MailServerPassword = "yourpassword"
JMail.Send("mail.mydomain.com")
%>
  

Important Notes

  • Emails must be sent from a valid email address hosted on Fast2Host servers. Otherwise, authentication will fail and the email will not be sent.
  • Replace mail.mydomain.com with your actual SMTP server hostname.
  • Use your full email address and password for authentication.
  • Always test your script by sending to a known recipient before deploying.

Best Practices

  • Enable SSL/TLS: If your hosting supports secure connections, configure JMail to use SSL for added security.
  • Use alternate SMTP ports: If port 25 is blocked by your ISP, use Fast2Host’s alternate ports (Windows hosting: 49, Linux hosting: 26).
  • Log errors: Enable JMail logging to troubleshoot delivery issues.
  • Validate input: Always sanitize form input to prevent abuse or injection attacks.
✔ Tip: JMail is suitable for legacy ASP sites. For modern ASP.NET applications, consider using System.Net.Mail for better security and compatibility.
Was this article helpful?

mood_bad Dislike 0
mood Like 1
visibility Views: 10697

Need more information or have a question ?