英HTML mailto link
Posted 前端早读课
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了英HTML mailto link相关的知识,希望对你有一定的参考价值。
前言
mailto只知其一,原来还有这么多属性。本期英文来自@rapidtables分享。
正文从这开始~~
mailto: html email link, what is it, how to create, examples and code generator.
What is mailto link
Mailto link is a type of HTML link that activates the default mail client on the computer for sending an e-mail.
The web browser requires a default e-mail client software installed on his computer in order to activate the e-mail client.
If you have Microsoft Outlook, for example as your default mail client, pressing a mailto link will open a new mail window.
How to create mailto link in HTML
The mailto link is written like regular link with extra parameters inside the href attribute:
<a href="mailto:name@email.com">Link text</a>
Parameter | Description |
---|---|
mailto:name@email.com | e-mail recipient address |
cc=name@email.com | carbon copy e-mail address |
bcc=name@email.com | blind carbon copy e-mail address |
subject=subject text | subject of e-mail |
body=body text | body of e-mail |
? | first parameter delimiter |
& | other parameters delimiter |
mailto examples
Mail to email address
<a href="mailto:name@rapidtables.com">Send mail</a>
Pressing the above link will open a new mail window:
Mail to email address with subject
The %20 represents space character.
Pressing the above link will open a new mail window:
Mail to email address with cc, bcc, subject and body
The %20 represents space character.
Pressing the above link will open a new mail window:
How to add spaces in the mail's subject or body
You can add spaces by writing %20 in the text of the subject or body.
How to add line break in the mail's body
You can add newline by writing %0D%0A in the text of the body.
How to add multiple email recipients
You can add multiple recipients by writing a comma separator (,) between email addresses.
<a href="mailto:name1@mail.com,name2@mail.com">Send mail</a>
以上是关于英HTML mailto link的主要内容,如果未能解决你的问题,请参考以下文章