ASP uses the function of JMail letter

Source: Internet
Author: User
Tags mail requires
function of jmail| function ASP using JMail letter

' 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



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.