Tips for using mailto _ basic knowledge-js tutorial

Source: Internet
Author: User
How to Use mailto? For most people, it is not very unfamiliar, but have you noticed the practical details? Next, I will share my experience in the use process. For more information, see Mailto usage
How to Use mailto?
1) basic usage

The Code is as follows:


Send email


Or

The Code is as follows:




Mailto is followed by the recipient.
List of available parameters
To Recipient
Suject Topic
Cc CC
Bcc Dark CC
Body Content

The parameter passing method is the same as passing values between pages. You can use a query string or form
Querystring Method:

The Code is as follows:


Send mail


Form

The Code is as follows:




Both methods also pass all parameters.
2) Example

The Code is as follows:





Send Email





Script
Date. prototype. toString = function ()
{
Var d = new Date ();
Var ret = d. getYear ();
Var m = d. getMonth () + 1;
Ret + = m. length> 1? M: '0' + m;
Var date = d. getDate ();
Ret + = date. length> 1? Date: '0' + date;
Return ret;
}
Var initSubject = 'test' + new Date (). toString (), initTo = 'sample @ 163.com ', initCC = 'sample @ hotmail.com', initBody = 'use mailto sample ';
Function submitHandler ()
{
Var subject = subText. value;
Var to = toText. value;
Var cc = ccText. value;
Var body = bodyText. value;
MailTo. href = "mailto:" + to + "? Cc = "+ cc +" & subject = "+ subject +" & body = "+ body;
MailTo. click ();
}
Function init ()
{
SubText. value = initSubject;
ToText. value = initTo;
CcText. value = initCC;
BodyText. value = initBody;
}
Script


Use mailto Send Email



Subject:



To:



CC:



Body:







Find ways for winners and find excuses for losers!

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.