Use Jmail.message to send mail

Source: Internet
Author: User
Tags character set mail save file
This section of code involves most common methods of JMail v4.3.
Includes basic message information, authentication, attachments, and so on. You can use it without a lot of modifications, or you can change it to a function or procedure.

<%
Dim JMail, ContentID
Set JMail = Server.CreateObject ("Jmail.message")

Jmail.charset = "gb2312" message character set, default to "Us-ascii"
' Jmail.isoencodeheaders = False ' is ISO-encoded, default to True

' Sender information (available in variable mode assignment)
Jmail.from = "jiaz@21cn.com" ' Sender address
Jmail.fromname = "D.J." ' Sender name
Jmail.subject = "You are in the glare of the News lyrics Express (please set the encoding to Simplified Chinese (gb2312))" ' Mail subject

' Authentication
Jmail.mailserverusername = user name authenticated by "user"
Jmail.mailserverpassword = "Password" Authenticated password

' Set priority, range from 1 to 5, higher priority, 3 normal
Jmail.priority = 3

Jmail.addheader "Originating-ip", Request.ServerVariables ("REMOTE_ADDR")

' Add a recipient ' variable email: recipient address ' can be repeated by adding multiple
Jmail.addrecipient (email)

' Add attachment ' variable filename: The absolute address of the attachment file to ensure the user IUSR_???? Have access Permissions "
' "Parameter setting is (True) No (False) is inline mode"
ContentID = jmail.addattachment (filename, True)

' Message body (HTML (note how attachments are linked within a letter)
Jmail.htmlbody = "
' Message body (text section)
Jmail.body = "Our messages are in HTML format, but your mail viewing software may not be supported." You can access the following address to view: http://music.liuxuan.com

' Send ' call format: Objjmail.send ([username:password@]smtpserveraddress[:P ort])
Jmail.send ("user:password@smtp.21cn.com")

' Close and clear the object
Jmail.close ()
Set JMail = Nothing
%>


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.