Send mail with ASP

Source: Internet
Author: User
Tags object end mail sendmsg
You can send messages through the JMail component. First you install the JMail component on the Web server. The following is an object instance that can be invoked via call SendMail (receive) to send mail

You can send messages through the JMail component.
First you install the JMail component on the Web server.
The following is an object instance that can be invoked via call SendMail (receive) to send mail
<%
Sub SendMail (receive)
On Error Resume Next
Set JMail = Server.CreateObject ("JMail. Message ")
Jmail.silent = False ' mask exception error, return False to true two value
Jmail.logging = True ' Enable mail logging
JMail. Charset = "gb2312"
JMail. AddRecipient receive ' Mail Recipient's address
JMail. from = "admin@XXX.com.cn" ' e-mail address of sender
JMail. FromName = "Subject" ' Sender name
JMail. Mailserverusername = "Admin" Mailbox user name
JMail. Mailserverpassword = "xxx" ' Mailbox password
JMail. Subject = "message" ' Mail subject
JMail. BODY = "Body" ' mail content
JMail. Priority = 3 ' Mail Emergency program, 1 for fastest, 5 for slowest, 3 for default value
mailserver= "Smtp.xxx.net" ' Outgoing server
JMail. Send (mailserver) ' Perform mail delivery (via mail server address)
If Err.number<>0 Then
Sendmsg= "Send failed! "
Else
Sendmsg= "has been sent! "
End If
Response.Write (sendmsg)
JMail. Close ()
Set jmail=nothing
End Sub
%>
JMail components can be downloaded online



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.