- Ссылка на адрес электронной почты
- HTML по теме
- Популярные рецепты
- Популярные задачи
- How to Create Mailto Links
- The following fields can be filled out beforehand:
- The downside of Mailto links
- HTML mailto link
- What is mailto link
- How to create mailto link in HTML
- mailto examples
- Mail to email address
- Mail to email address with subject
- Mail to email address with cc, bcc, subject and body
- How to add spaces in the mail’s subject or body
- How to add line break in the mail’s body
- How to add multiple email recipients
- Mailto link code generator
- See also
- HTML — Email Links
- HTML Email Tag
- Default Settings
- How to Create an Email Link in HTML
- Community Q&A
Ссылка на адрес электронной почты
Создание ссылки на адрес электронной почты делается почти также как и ссылка на веб-страницу. Только вместо URL указывается mailto:адрес электронной почты (пример 8.6).
Пример 8.6. Ссылка на адрес электронной почты
Задавайте вопросы по электронной почте
Можно также автоматически добавить тему сообщения, присоединив к адресу электронной почты через символ вопроса (?) параметр subject=тема сообщения , как показано в примере 8.7.
Пример 8.7. Задание темы сообщения
Задавайте вопросы по электронной почте
При запуске почтовой программы поле Тема (Subject) будет заполнено автоматически.
HTML по теме
Не выкладывайте свой код напрямую в комментариях, он отображается некорректно. Воспользуйтесь сервисом cssdeck.com или jsfiddle.net, сохраните код и в комментариях дайте на него ссылку. Так и результат сразу увидят.
Популярные рецепты
- Как добавить картинку на веб-страницу?
- Как добавить иконку сайта в адресную строку браузера?
- Как добавить фоновый рисунок на веб-страницу?
- Как сделать обтекание картинки текстом?
- Как растянуть фон на всю ширину окна?
- Как выровнять фотографию по центру веб-страницы?
- Как разместить элементы списка горизонтально?
- Как убрать подчеркивание у ссылок?
- Как убрать маркеры в маркированном списке?
- Как изменить расстояние между строками текста?
- Как сделать, чтобы картинка менялась при наведении на нее курсора мыши?
- Как открыть ссылку в новом окне?
Популярные задачи
- TEX
- Отступы между блоков
- Андроид в тени
- Ссылка как кнопка
- Вложенные списки
- Форма регистрации
- Объединение ячеек таблицы
- Обязательные поля формы
- Цвет и фон в таблице
- Асуанская плотина
- Батарейка
- Заголовки
How to Create Mailto Links
Mailto links are used to redirect to an email address instead of a web page URL. When a user clicks on the Mailto link, the default email client on the visitor’s computer opens and suggests sending a message to the email address mentioned in the Mailto link.
If you want to receive the email to more than one address, separate your email addresses with a comma:
a href="mailto:[email protected], [email protected]">Send Email
The following fields can be filled out beforehand:
- subject — for the subject line,
- cc — for sending a carbon copy,
- bcc — for sending a blind carbon copy,
- body — for the message’s body text.
If you want to have a subject field, which is already filled out, add the “subject” parameter to the href attribute:
a href="mailto:[email protected]?subject=Mail from our Website">Send Email
To add CC and BCC to your email, use the «cc» or «bcc» parameter on the href attribute:
a href="mailto:[email protected][email protected], [email protected], &[email protected]&subject=Mail from our Website">Send Email
To add a body text, use the «body» parameter with other parameters:
a href="mailto:[email protected][email protected], [email protected], &[email protected]&subject=Mail from our Website&body=Some body text here">Send Email
Putting all together, we’ll have the following example.
The downside of Mailto links
Using Mailto links is quite easy and helpful, but it also has downsides for many users. Mailto links can lead to appearing in spam. It’s one of the most common ways used by spammers.
Even if you don’t receive many spams, or have a good spam filter, you cannot escape from spam emails. It’s better to use a Mailto form on your website instead of a Mailto link.
HTML mailto link
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:
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
The code will generate this link:
Pressing the above link will open a new mail window:
Mail to email address with subject
The %20 represents space character.
The code will generate this link:
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.
The code will generate this link:
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.
Mailto link code generator
* the mailto link will not work if the user did not define a default mail app in his computer.
See also
HTML — Email Links
It is not difficult to put an HTML email link on your webpage but it can cause unnecessary spamming problem for your email account. There are people, who can run programs to harvest these types of emails and later use them for spamming in various ways.
You can have another option to facilitate people to send you emails. One option could be to use HTML forms to collect user data and then use PHP or CGI script to send an email.
A simple example, check our Contact Us Form. We take user feedback using this form and then we are using one CGI program which is collecting this information and sending us email to the one given email ID.
Note − You will learn about HTML Forms in HTML Forms and you will learn about CGI in our another tutorial Perl CGI Programming.
HTML Email Tag
This code will generate the following link which you can use to send email.
Now, if a user clicks this link, it launches one Email Client (like Lotus Notes, Outlook Express etc. ) installed on your user’s computer. There is another risk to use this option to send email because if user do not have email client installed on their computer then it would not be possible to send email.
Default Settings
You can specify a default email subject and email body along with your email address. Following is the example to use default subject and body.
This code will generate the following link which you can use to send email.
How to Create an Email Link in HTML
This article was co-authored by wikiHow staff writer, Travis Boylls. Travis Boylls is a Technology Writer and Editor for wikiHow. Travis has experience writing technology-related articles, providing software customer service, and in graphic design. He specializes in Windows, macOS, Android, iOS, and Linux platforms. He studied graphic design at Pikes Peak Community College.
The wikiHow Tech Team also followed the article’s instructions and verified that they work.
This article has been viewed 576,203 times.
Do you want to make it easy for your website visitors to send you an email? Creating an HTML mailto link makes it so your visitors can quickly send you a message just by clicking a hyperlink that opens a new message to the email address of your choice. We’ll show you the proper tags and syntax to use to create simple HTML email hyperlinks on your website.
Type the users email next. A properly formatted command so-far would be agentavery@sample.com » . [3] X Research source
- If you want to add this to your command, it should look like this so far: agentavery@sample.com?subject=»subject text»
- Try not to use characters that aren’t alphanumeric in the subject line. There are ways to work around this so your link doesn’t get stumped and thinks it’s part of something else».
- While most often not used, it is possible to add information to prefill the subject line via the mailto syntax. However, it’s more often used when the mail is being sent to a server inside a robot that handles incoming mail so it can be processed later (so it can be filtered).
- You can add «body» as well as a cc or a bcc line using a similar syntax. Just make sure to use a question mark followed by the term «body»,»cc», or «bcc» followed by an equals sign followed by the text for that line in a pair of quotation marks.
Type > to add a closing bracket. So far, our HTML commands tell the web browser what email address to link to, and to add a subject/cc/bcc. The closing bracket «>» tells the web browser that there are no more commands to execute when the link is clicked.
Type link text. This is the text the user clicks on to open the email link. It goes after the closing bracket. This can be a word, a phrase, or even a duplicate copy of the person’s email address this is being sent to. Most often, this can be the phrase «here» or «this» or something of that sort.
Continue the remainder of the HTML document. Be sure to save your work. If you have more HTML to add to your document, continue your work.
Community Q&A
How can I create a personal email system with @my website name, so a user or client can chat me directly through it and how do I create a chat platform or interface just like a messaging platform?
If you have Cpanel you can go to the «Email Accounts» and click on the «Create» button (generally on the right) and create whatever name@yourwebsite.com you want. After you have created the email address, go to softaculous Apps (in Cpanel), then go to «Customer Support» and download one of the help desk apps. Direct the messages to the set email.
Thanks! We’re glad this was helpful.
Thank you for your feedback.
As a small thank you, we’d like to offer you a $30 gift card (valid at GoNift.com). Use it to try out great new products and services nationwide without paying full price—wine, food delivery, clothing and more. Enjoy! Claim Your Gift If wikiHow has helped you, please consider a small contribution to support us in helping more readers like you. We’re committed to providing the world with free how-to resources, and even $1 helps us in our mission. Support wikiHow
HTML is a markup language that doesn’t require any special download since the tools needed are already installed on your computer, e.g notepad, notepad++, etc. But you might consider getting more advanced and flexible software to run your codes in real-time, those includes sublime text, brackets, atom, vs code, etc.
Thanks! We’re glad this was helpful.
Thank you for your feedback.
As a small thank you, we’d like to offer you a $30 gift card (valid at GoNift.com). Use it to try out great new products and services nationwide without paying full price—wine, food delivery, clothing and more. Enjoy! Claim Your Gift If wikiHow has helped you, please consider a small contribution to support us in helping more readers like you. We’re committed to providing the world with free how-to resources, and even $1 helps us in our mission. Support wikiHow
Highlight the text you want to link, click the link icon, and select «Email» from the drop-down. (Optional) Edit the text you want to display as the link. Enter the email address you want contacts to send to in the Email address field. Click Insert. Click Done.
Thanks! We’re glad this was helpful.
Thank you for your feedback.
As a small thank you, we’d like to offer you a $30 gift card (valid at GoNift.com). Use it to try out great new products and services nationwide without paying full price—wine, food delivery, clothing and more. Enjoy! Claim Your Gift If wikiHow has helped you, please consider a small contribution to support us in helping more readers like you. We’re committed to providing the world with free how-to resources, and even $1 helps us in our mission. Support wikiHow