SoFunction
Updated on 2025-03-09

The function that is absolutely useful for sending emails by Jmail components

It is roughly as follows:

1. The POP3 object is an operation on the POP3 email receiving server.
2. Messages object is an object related to the mail collection.
3. Message object is an object related to mail. It is the most commonly used object of Jmail component. It can send email information and receive email information.
4. The header object is an object related to the email header.
5. The Recipients object is an object related to the collection of receiving mails.
6. The Recipient object is the object related to receiving mail.
7. Attachments object is an object related to a collection of mail attachments.
8. Attachment object is an object related to mail attachments.
9. The MailMerge object is an object related to the mail template.
10. The PGPKeys object is an object related to the mail PGP key collection.
11. The PGPKeyInfo object is an object related to the PGP key information of the email.
……

In web applications sent by email, Message objects are the most commonly used. Before using them, you need to create the object and assign it to a variable.


Set jmail = ("")


There are the following commonly used properties and methods for Message objects:

1. Silent attribute indicates that the exception error is blocked and returns the FALSE or TRUE value. When the value is TRUE, it means that the error will be ignored by the email sending and the error message will not be returned to the operating system.
= true

2. Logging attribute indicates whether logging is enabled.
= true

3. Charset attribute, set the character set displayed by email, GB2312 can be used in simplified Chinese.
= "GB2312"

4. ContentType attribute, indicating the type of the email body.
= "text/html"

5. AddRecipient method, indicating the recipient's E-Mail address.
("cnbruce@")

6. From attribute, indicating the sender's E-Mail address. This address is generally the same as the login account required when using the SMTP server to verify.
= "dw8asp@"

7. FromName attribute, indicating the sender's name.
= "BruceWolf"

8. Subject property, indicating the title of the sending email.
= "This is the title of the email"

9. Body attribute, which indicates the content of the sending email. You can use HTML tag code
= "This is the content of the email<br>The content of the line break is displayed"

10. Priority attribute indicates the priority of sending emails. 1 is the fastest, 5 is the slowest, and 3 is the default value.
= 1

11. The MailServerUserName property represents the login account set when the mail server sends a message verification using SMTP.
= "dw8asp@"

12. The MailServerPassword property indicates the login password set when the mail server uses SMTP to send a message verification.
= "**************"

13. Send method, which means sending mail through the specified mail sending server. It should be noted that the mail server address is consistent with the values ​​in MailServerUserName and MailServerPassword.
("smtp.")

14. The Close method represents the cache space used to free Jmail and the mail server connection.
()

Due to the different mail servers, different sending email recipients, and different email titles and contents, combining these often-changing values, customizing the following functions to complete the function of sending emails by Jmail.

Jmail mail sending function


<%
Function Send_Email(smtpHost,smtpUser,smtpPass,mailTo,FromName,subject,content)
Set jmail = ("")
= true
= true
= "gb2312"
= "text/html"
mailTo
= smtpUser
= FromName
= subject
= content
= 1
= smtpUser
= smtpPass
(smtpHost)
()
("Email sent successfully")
End Function
%>



Where Send_Email represents the custom function name
Parameter smtpHost represents the mail server address
The parameter smtpUser represents the login account required for sending a message verification.
Parameter smtpPass indicates the login password required for sending a message verification.
The parameter mailTo represents the E-Mail address of the email recipient
Parameter FromName represents the name of the sender of the email
The parameters subject and content represent the title and content of the email respectively

This function can be applied by the following method:
Call Send_EMail("smtp.","dw8asp@","******","cnbruce@","cnbruce","title","email text content")

Or havePersonal post officeAvailable for use
Call Send_EMail("","root@","******","cnbruce@","cnbruce","title","email text content")

jmail component download address:https:///softs/