Send detailed ASP and jmail to send emailsCodeA simple jmail email code was sent some time ago. Today, we will make a specific annotation for this code and add the code in two other formats, here are a few simple examples:
The core code of jmail. smtpmail is as follows:
Copy code The Code is as follows: <%
Set jmail = server. Createobject ("jmail. smtpmail") 'creates a jmail object
Jmail. Silent = true 'jmail does not throw exception errors. The returned values are false and true.
Jmail. Logging = true' enable use Log
Jmail. charset = "gb2312" 'the email text code is simplified Chinese
Jmail. contenttype = "text/html" 'the email format is html
Jmail. serveraddress = "server address" 'server for sending emails
Jmail. addrecipient email 'email recipient
Jmail. sendername = "sendername" 'name of the email sender
Jmail. Sender = "email address" 'email address of the sender
Jmail. Priority = 1' urgent email Program , 1 is the fastest, 5 is the slowest, and 3 is the default value
Jmail. Subject = "mail subject" 'mail title
Jmail. Body = "mail body" 'mail content
Jmail. addrecipientbcc email 'address of the BCC recipient
Jmail. addrecipientcc email 'email CC address
Jmail. Execute () 'execute the mail to send
Jmail. Close 'Close the email object
%>
W3 jmail4.3 component re-designs its internal structure -- uses the message object instead of the original single object jmail. smtpmail sends an email. Some methods require authentication (such as 163 and Yahoo). You can use the following methods to solve this problem:
Copy code The Code is as follows: <%
Set jmail = server. Createobject ("jmail. Message") 'creates the email sending object.
Jmail. Silent = true' to block exception errors. The values false and true are returned. j
Mail. Logging = true' enable Mail Log
Jmail. charset = "gb2312" 'the text of the email is encoded as the national standard
Jmail. contenttype = "text/html" 'the mail format is html
Jmail. addrecipient email 'email recipient's address
Jmail. From = "email from for Sender" 'sender's E-MAIL address
Jmail. mailserverusername = "username of email" 'username required to log on to the email server
Jmail. mailserverpassword = "password of email" 'Password required to log on to the email server
Jmail. Subject = "mail subject" 'mail title
Jmail. Body = "mail body" 'mail content
Jmail. prority = 1' urgent mail program, 1 is the fastest, 5 is the slowest, 3 is the default
Jmail. Send ("server address") 'executes the mail sending (via the mail server address)
Jmail. Close () 'Close the object
%>