JMail
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
%>