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!