Jmail component usage (ASP)

Source: Internet
Author: User
Tags email account

function Sendmail (mailtoaddress, mailtoname, subject, mailbody, fromname, mailfrom)
'function parameter description (recipient address, Recipient Name (optional), topic, mail content, sender name (optional), sender address)
'on error resume next
dim jmail, MailServer, flag
set jmail = server. createobject ("jmail. message ")
If err then
Sendmail = false
err. clear
exit function
end if
jmail. charset = "gb2312" 'email encoding
jmail. silent = true
jmail. contenttype = "text/html" 'mail body format
MailServer = "smtp.126.com" 'is the SMTP server used to send emails
jmail. mailserverusername = "xiaonan126" 'logon username/Note: Enter the email account you applied for in 163
jmail. mailserverpassword = "840629" 'logon password/Note: enter the password of your 163 email account
jmail. maildomain = "126.com" 'domain name (if you use a user name such as" name@domain.com ", specify domain.com), optional
jmail. addrecipient mailtoaddress, mailtoname 'recipient's email address and recipient's name
jmail. subject = subject 'topic

jmail. appendhtml (mailbody)
jmail. fromname = fromname 'sender's name
jmail. from = mailfrom 'sender email
jmail. priority = 1' mail level, 1 is urgent, 3 is normal, 5 is low
flag = jmail. send (MailServer)
if flag then
Sendmail = true
else
Sendmail = false
end if
jmail. close
set jmail = nothing
If sendmail = true then
response. write ("")
else
response. write ("")
end if
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.