Jmail email sending Function

Source: Internet
Author: User

 

Sub Sendmail (explorer, CC, sender, username, password, subject, content, MailServer)
Set Jmail = Server. Createobject ( " Jmail. Message " ) ' Create an email recipient
Jmail. Silent =   True ' Block exception errors. Return false and true values J.
Mail. Logging =   True ' Enable Mail Log
Jmail. charset =   " Gb2312 " ' The text code of the email is the National Standard
Jmail. contenttype =   " Text/html " ' The email is in HTML format.
Jmail. addrecipient Receiver ' Email Recipient address
Jmail. addrecipientcc CC ' Email CC address
Jmail. From = Sender ' The sender's E-MAIL address
Jmail. mailserverusername = Username ' Username required to log on to the email server
Jmail. mailserverpassword = Password ' Password required to log on to the email server
Jmail. Subject = Subject ' Email title
Jmail. Body = Content ' Email content
' Jmail. prority = 1' urgent mail program, 1 is the fastest, 5 is the slowest, 3 is the default
Jmail. Send (MailServer) ' Execute email sending (via email server address)
Jmail. Close () ' Close object
End sub

If Request ( " Action " ) = " Sendmail "   Then
Strreceiver =   " 8888@vip.163.com "
Strcc =   " Stone@hotmail.com "
Strsender =   "S Tone@163.com "
Strusername =   " Stone@163.com "
Strpassword =   888888 "
Strsubject =   " Website order -- " & Now ()
Strcontent =   " Product: " & Request ( " Product " ) & " <Br> Company Name: " & Request ( " Compname " ) & " <Br> company phone number: " & Request ( " Phone " ) & " <Br> Fax Number: " & Request ( " Fax " ) & " <Br> Email: " & Request ( " Email " ) & " <Br> contact: " & Request ( " Truename " ) & " <Br> contact address: " & Request ( " Address " ) & " <Br> note: " & Request ( " Other " ) & ""
Strmailserver =   " Smtp.163.com "  
Call Sendmail (strreceiver, strcc, strsender, strusername, strpassword, strsubject, strcontent, strmailserver)
Response. Write ( " <SCRIPT> alert ('order sent successfully'); window. Location. href = 'home. asp '</SCRIPT> " )
End   If

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.