我们已经准备好了,你呢?

我们与您携手共赢,为您的企业形象保驾护航!

当前位置: 首页 > 问答 > htmlmailto

HTML Mailto

HTML Mailto

The mailto link is used to create a link that opens the user's email program with a pre-filled email address

subject

and body.

Syntax

The mailto link is created using the anchor <a> element and the href attribute.

<a href="mailto:email@example.com">Send email</a>

The email address should be prefixed with mailto:. For example

mailto:email@example.com.

Additional Parameters

Additional parameters can be added to the mailto link to pre-fill the subject and body of the email. The subject parameter is used to specify the subject of the email

and the body parameter is used to specify the body text.

<a href="mailto:email@example.com?subject=Hello%20World&body=This%20is%20the%20body%20of%20the%20email.">Send email with subject and body</a>

In the above example

the subject is set to "Hello World" and the body is set to "This is the body of the email." The space characters in the parameters should be URL-encoded using "%20".

URL Encoding

URL encoding is used to convert special characters and spaces into a format that can be transmitted over the internet. In mailto links

spaces should be replaced with "%20"

and other special characters should be replaced with their corresponding percent-encoded values.

For example:

  • Space: %20
  • At sign (@): %40
  • Question mark (?): %3F

Conclusion

The mailto link is a convenient way to create email links that open the user's email program with a pre-filled email address

subject

and body. It is widely used in HTML forms and websites to allow users to easily contact the website owners or administrators.

免责声明:本站内容(文字信息+图片素材)来源于互联网公开数据整理或转载,仅用于学习参考,如有侵权问题,请及时联系本站删除,我们将在5个工作日内处理。联系邮箱:chuangshanghai#qq.com(把#换成@)

我们已经准备好了,你呢?

我们与您携手共赢,为您的企业形象保驾护航!

在线客服
联系方式

热线电话

132-7207-3477

上班时间

周一到周五 09:00-18:00

二维码
线