jmail| function ' ************************************************************************************
' Author: loster (oicq:181306) [if reproduced please do not delete this information, thank you!] ]
' Function name: Send_email ()
' Function: Send e-mail using Jmail4.3 component
Parameters
' Email: Type: String. Function: Receive e-mail address.
' E_subject: Type: String. function: letter subject.
' Information: Type: String. Function: Letter contents.
' S_type: Type: Boolean value. Function: Whether for HTML-format letters. True is HTML format. False is a text format.
' C_m_chk: Type: Boolean value. Function: Whether the SMTP server requires authentication
' If the send succeeds, the function returns true otherwise returns false
'************************************************************************************
Function Send_email (EMAIL,E_SUBJECT,INFORMATION,S_TYPE,C_M_CHK)
Const c_email= "" ' Sender's mailbox
Const c_hostname= "" ' Sender's name
Const c_smtp= "smtp.xxx.com" SMTP server address
Const c_m_user= "" ' If the SMTP server requires authentication, 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.Clear
End Function