[Original] ASP uses JMail letter to function

xiaoxiao2021-03-06  36

'********************************************************** *****************************************

'Author: Loster (OICQ: 181306) [if reproduced do not delete this information, thank you! ]

'Function name: send_email ()

'Role: Send e-mail using JMail4.3 components

'parameter:

'Email: Type: String. Role: Receive the address of E-mail.

'E_SUBJECT: Type: String. Role: Letter theme.

'Information: Type: String. Role: Letter content.

'S_type: Type: Boolean. Role: Whether it is an HTML format letter. TRUE is HTML format. False is a text format.

'C_m_chk: Type: Boolean. Role: Does the SMTP server require authentication

'If the send is successful, the function will return true otherwise returning false

'********************************************************** *****************************************

Function Send_Email (Email, E_SUBJECT, INFORMATION, S_TYPE, C_M_CHK)

Const c_email = "" 'sender's mailbox

Const c_hostname = "" "'The name of the sender

Const c_smtp = "smtp.xxx.com" 'SMTP server address

Const c_m_user = "" "If the SMTP server needs to verify the identity, please enter the username.

Const c_m_pass = "" "Please enter your password

Dim Sender Err.Clear On Error Resume Next If Email = "" Or Information = "" Or E_Subject = "" Then Send_Email = False Exit Function End If set Sender = Server.CreateObject ( "Jmail.message") Sender.Logging = true Sender.From = C_Email Sender.Fromname = C_HostName sender.addrecipient Email sender.subject = E_Subject If s_Type = False Then sender.appendtext Information Else Sender.AppendHtml Information End If sender.maildomain = C_Smtp If C_M_Chk = True Then sender.mailserverusername = C_M_User Sender.mailServerPassword = c_m_pass end if sender.priority = 1 sender.send (c_smtp)

If Err.Number <> 0 Then Send_email = false else send_email = true end if err.clearend function

转载请注明原文地址:https://www.9cbs.com/read-65782.html

New Post(0)