Jmail component application instance

Source: Internet
Author: User
Tags servervariables mail account
<%
Sub Sendmail (mail_to, mail_subject, mail_body)
'On error resume next
Dim jmail
Userip = request. servervariables ("http_x_forwarded_for ")
If userip = "" Then userip = request. servervariables ("remote_addr") 'get the real IP Address
Set jmail = server. Createobject ("jmail. Message ")
Jmail. Silent = true
Jmail. charset = "gb2312" 'character set, "US-ASCII" by default"
Jmail. isoencodeheaders = false
Jmail. mailserverusername = "sanmao-2000@163.com" 'mail account
Jmail. mailserverpassword = "*******" 'mail Password
Jmail. From = "sanmao-2000@163.com" 'sender's email address
Jmail. fromname = "liuyun" 'sender's name
Jmail. Subject = mail_subject 'sets the mail title
'Jmail. replyto = "liuyun-11912@163.com" 'specifies a return address
Jmail. Priority = 1
Jmail. addheader "originating-IP", userip' Add User-defined mail headers
Jmail. addrecipient (mail_to) 'recipient email address
Jmail. Body = mail_body 'mail body
Jmail. Send ("smtp.163.com") 'smtp address
Jmail. Close ()
Set jmail = nothing
Response. Write "Send OK ."
End sub

Call Sendmail ("deeone@tom.com", "mail test.", "Hi, now OK !!! ")
%>

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.