SoFunction
Updated on 2025-03-09

Asp jmail email Detailed analysis Page 1/2

Send more detailed codes to send emails to asp and jmail. A while ago, I sent a simple JMAIL email to send emails. Today I will make a specific annotation of this code and add two other format codes, and give a few simple examples:

First of all, the core code:

Copy the codeThe code is as follows:

<%  
Set jmail = ("") 'Create a JMAIL object
= true 'JMAIL will not throw exception errors, the returned values ​​are FALSE and TRUE
= true 'Enable usage log
= "GB2312" 'The code of the email text is Simplified Chinese
= "text/html" 'The format of the email is HTML
= "Server Address" 'The server that sends the email
Email’The recipient of the email
= "SenderName" 'The name of the sender of the email
= "Email Address" 'The email address of the email sender
= 1 'Emergency Program for Mail, 1 is the fastest, 5 is the slowest, 3 is the default
= "Mail Subject" 'Title of the email
= "Mail Body" 'The content of the email
Email 'The address of the recipient of the password
Email 'The address of the cc user
() 'Execute email send
'Close the mail object
%>  

w3 Jmail4.3 component has redesigned its internal structure - using Message objects to send emails instead of the original single object. Some methods require authentication (such as 163, yahoo, etc.), can be solved by using the following method:

Copy the codeThe code is as follows:

<%  
Set jmail = ("") 'Create the object to send the email
= true 'Mask exception error, return two values ​​of FALSE and TRUE j
= true 'Enable email log
= "GB2312" 'The text code of the email is national standard
= "text/html" 'The format of the email is HTML
Email 'The address of the email recipient
= "Email From for Sender" 'E-MAIL address of the sender
= "UserName of Email" 'The username required to log in to the mail server
= "Password of Email" 'Password required to log in to the mail server
= "Mail Subject" 'Title of the email
= "Mail Body" 'The content of the email
= 1 'Emergency Program for Mail, 1 is the fastest, 5 is the slowest, 3 is the default
("Server Address") 'Execute email sending (through the mail server address)
() 'Close the object
%> 

12Next pageRead the full text