


Talking about the practical application of html mailto (e-mail)_HTML/Xhtml_web page production
As we all know, mailto is a very practical HTML tag in web design and production. Many friends who have personal web pages like to write their email address in a prominent position on the website, so that once the web browser clicks with the mouse, After the super connection formed by mailto, the default email client software in the current computer system can be automatically opened, such as OutLook Express and Foxmail.
However, since various operating systems and mail clients handle mailto event connections inconsistently, you need to pay attention when applying them in practice;
1. Basic syntax
send email
or
Parameter list:
to | 收信人(多个之间用;分割) |
suject | 主题 |
cc | 抄送 |
bcc | 暗抄送 |
body | 内容(部分邮件客户端支持html格式语句) |
link string
send mail
form method
2. Mail client differences
The above is a simple syntax application of mailto; but in actual application, depending on the browser client settings of the browser, there will be different effects;
Especially when the body content contains statements in html format, this You need to pay attention when doing so;
Outlook displays the html statement of the body as it is (it is also invalid after escaping the html of the body), so what should we do if we want to wrap the statements in the body when doing Outlook mailto?
has no effect. . Need to use character as a newline symbol;
foxmail will display the corresponding html effect of the html statement of the body;
Of course, you can also use another way to implement a mailto-type client to send emails:
function SendMail(filePath) {
var path = location.href.substring(0, location.href.lastIndexOf("/")) filePath;
var outlookApp = new ActiveXObject("Outlook.Application");
var nameSpace = outlookApp.getNameSpace( "MAPI");
var mailItem = outlookApp.CreateItem(0);
var mailto = "test@163.com ";
var mailBody= "
mailItem.Subject = "test title";
mailItem.To = mailto;
mailItem.HTMLBody = mailBody;
if (path != "") {
mailItem.Attachments.Add(path);
}
mailItem. Display(0);
mailItem = null;
nameSpace = null;
outlookApp = null;
}
But this has a big disadvantage: only To support the Outlook client, you need to configure the Internet options and enable "Initialize and script run ActiveX controls not marked as safe".
The Attachments.Add of mailItem is called to add attachments to the email. When there are no attachments, the filePath parameter can be deleted.
If you need to add a CC object, you can call mailItem.Cc. If you need to add a CC object, you can call the mailItem.Bcc method.

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Outlook offers many settings and features to help you manage your work more efficiently. One of them is the sorting option that allows you to categorize your emails according to your needs. In this tutorial, we will learn how to use Outlook's sorting feature to organize emails based on criteria such as sender, subject, date, category, or size. This will make it easier for you to process and find important information, making you more productive. Microsoft Outlook is a powerful application that makes it easy to centrally manage your email and calendar schedules. You can easily send, receive, and organize email, while built-in calendar functionality makes it easy to keep track of your upcoming events and appointments. How to be in Outloo

Apple offers a privacy-focused feature called "Hide Email Address" that allows users to hide their real email addresses on apps or websites that require account registration. We've taught you how to use this feature on your iPhone, now let's take a look at what's possible when using it in your daily work. What is a hidden email address on iPhone? The purpose of the Hide Email Address feature is to protect the privacy of your email address. By providing a temporary email address for application and website registration, you do not need to directly provide a person's real email address. This feature allows you to generate multiple iCloud email addresses for signing up with different services, thus avoiding revealing your true email address.

How to implement a simple email sending program using C++? With the popularity of the Internet, email has become an indispensable part of people's daily life and work. In C++ programming, we can use the SMTP (SimpleMailTransferProtocol) protocol to implement a simple email sending program. This article will introduce how to write a basic email sending program using C++. First, we need to prepare some tools and libraries to implement our program. first

How to use Flask-Mail to send emails With the development of the Internet, email has become an important tool for people to communicate. When developing web applications, sometimes we need to send emails in specific scenarios, such as sending a welcome email after a user successfully registers, or sending a password reset email when a user forgets their password, etc. Flask is a simple and flexible Python Web framework, and Flask-Mail is an extension library for sending emails under the Flask framework. This article will introduce how to

PHP email templates: Customize and personalize your email content With the popularity and widespread use of email, traditional email templates can no longer meet people's needs for personalized and customized email content. Now we can create customized and personalized email templates by using PHP programming language. This article will show you how to use PHP to achieve this goal, and provide some specific code examples. 1. Create an email template First, we need to create a basic email template. This template can be an HTM

The characteristics of email are: 1. Low cost. Email uses a store-and-forward method to gradually transmit information on the network. It is not as direct as a phone call, but the cost is lower; 2. It spreads quickly. Email combines telephone communication and postal mail. It can transmit information as fast as a phone call and can be sent to any designated destination in the world within a few seconds; 3. It is very convenient; 4. It has a wide range of communication objects and can be connected to the network in any corner of the world. User contact; 5. The information is diverse and can be in various forms such as text, images, sounds, etc.; 6. It is relatively safe.

1. The email format includes the following elements: recipient, sender, subject, body, attachment and date. 2. The recipient specifies the recipient of the email. The recipient's email address usually consists of a username and a domain name, separated by the @ symbol. 3. Sender contains the sender information of the email, including name and email address. This information is displayed in the header of the email and shows the sender's identity to the recipient. 4. The subject is a brief summary of the email content. It is usually a concise and meaningful phrase that can help the recipient quickly understand the main content of the email.

The email address is a fixed format created by Ray Tomlinson: user@mail.server.name, which is similar to the address of the recipient when mailing a regular letter. In the format, user is the recipient's user name, and mail.server.name is the recipient's email server name. It can also be a domain name or an IP address represented by a decimal number. Each user's email address on the Internet is unique, which makes sending and receiving emails more convenient and accurate.
