Jmail Example 1 of Sending Email
Published: 2006-05-12
Save all the following code content as a jmail.asp file; just modify the email information in it to your own.
<%
On Error Resume Next
' Import JMAIL component
Dim jmail
Set jmail = Server.CreateObject("JMAIL.Message")
' Set SMTP server information
' Make sure your mailbox has enabled the SMTP service and has set a password or generated an authorization code
'jmail.Silent = true ' Silent mode, do not display error messages
'jmail.Logging = true ' Enable logging; you can view logs through the jmail.Log property
jmail.Charset = "utf-8" ' Set mail charset
jmail.MailServerUserName = "xxx@xxxx.com" ' Your mailbox username
jmail.MailServerPassword = "passwd" ' Your mailbox password or authorization code
jmail.From = "xxx@xxxx.com" ' Sender email address
jmail.FromName = "Sender Name" ' Sender name
jmail.AddRecipient "shouxinren@xxx.com" ' Recipient email address
jmail.Subject = "Email Subject" ' Email subject
jmail.Body = "Email Body" ' Email body
Response.Write("JMAIL Version d: " & jmail.Version)
' Set SMTP server parameters
jmail.ServerAddress = "smtp.yunyou.top" ' Mailbox SMTP server address
jmail.ServerPort = 25 ' Mailbox SMTP server port; it may be 465, 587, or 25, depending on the mail server settings
jmail.SSL = true ' true enables SSL encryption, false does not enable SSL encryption
jmail.Authentication = true ' Enable SMTP authentication
' Send email
jmail.Send("smtp.yunyou.top") ' Mailbox SMTP server address
Response.Write("ok ")
' Clean up the mail object
Set jmail = Nothing
%>
