<a href="mailto:info@hashcode.ru">Email</a> 

Often I meet the ill-fated mailto, which, after my imprudent pressing, opens MS Outlook. Does anyone else use them, and forgive me for their lack of literacy and incomprehension, which programs can be opened by clicking on such a link? Besides MS Outlook? And what other prefixes besides this exist?

    6 answers 6

    Clicking on mailto: type links opens the default program installed on the system for sending mail. If you install theBat, or, for example, the GMail web application, this program will open.

    • This is understandable, thanks, but the popularity of use? Do you often use this design as a programmer and as an ordinary user? - Spirit
    • 3
      Never :) - KiTE

    Scheme URI

    • Thank you very much for the list, I have been looking for something similar for a long time. It is strange that there is no "javascript:". - Spirit

    In a firefox, clicking on such a piece opens a window on what to choose. Including gmail, click it - the form of sending a letter with the address inserted opens. Opens right on http. In Orega, a similar thing, by default, it can open Yandex; all this can be customized. In addition, there is a small mailer in Orega.

    In short, there is more sense in this link :)

      In general, to send the form from the site use php and without any email programs ...
      do this:
      <a href="contacts.html">Email</a> .

      Here's the code for the contacts.html page:

       <html> <head> </head> <body> <form method="post" action="mail.php"> <p><strong>Ваше имя:</strong><br /> <input type="text" name="name" size="30"/> <br /> <strong>Имя компании:</strong><br /> <input type="text" name="company" size="30"/> <br /> <strong>Ваш e-mail (для ответа):</strong><br/> <input name="email" type="text" size="30" /> <br /> <strong>Ваш заказ:</strong><br /> <textarea name="mess" rows="6" cols="60"></textarea> <p> <input type="submit" value="Отправить сообщение"/> </p> </form> </body> </html> 

      And here is mail.php, which you should place in the same folder as contacts.html:

       <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1251"/> <title>Обратная связь</title> </head> <body> <?php $reg_test = "/^[a-z0-9](?:[a-z0-9\-\._]*[a-z0-9])@[a-z0-9](?:[a-z0-9\-]*[a-z0-9])\.[a-z0-9]+$/i"; if (isset($_POST['name'])) { $name = $_POST['name']; } if (isset($_POST['company'])) { $company = $_POST['company']; } if (isset($_POST['email'])) { $email = $_POST['email']; } if (isset($_POST['mess'])) { $mess = $_POST['mess']; } if (empty($name)) { echo "<b>Не указано имя!<p>"; echo "<a href=contacts.html>Вернуться к заполнению формы</a>"; exit; } else if (empty($company)) { echo "<b>Не указано имя компании!<p>"; echo "<a href=contacts.html>Вернуться к заполнению формы</a>"; exit; } else if (empty($email)) { echo "<b>Не указан e-mail!<p>"; echo "<a href=contacts.html>Вернуться к заполнению формы</a>"; exit; } else if (!preg_match($reg_test, $email)) { echo "<b>Не правильно указан e-mail!<p>"; echo "<a href=contacts.html>Вернуться к заполнению формы</a>"; exit; } else if (empty($mess)) { echo "<b>Сообщение не написано!<p>"; echo "<a href=contacts.html>Вернуться к заполнению формы</a>"; exit; } else $to = "info@prodimprt.pro"; /*УКАЗАТЬ СВОЙ АДРЕС!*/ $headers = "Content-type: text/plain; charset = windows-1251"; $subject = "ON-LINE заказ с сайта PRODIMPORT.PRO"; $message = "Имя пославшего: $name \nИмя компании:$company \nЭлектронный адрес: $email \nСообщение: $mess"; $send = mail($to, $subject, $message, $headers); if ($send == 'true') { echo "<b>Спасибо за отправку вашего сообщения!<p>"; echo "<a href=index.htm>Нажмите,</a> чтобы вернуться на главную страницу"; } else { echo "<p><b>Ошибка. Сообщение не отправлено!"; } ?> </body> </html> 
      • Thanks for the detailed code. It is worth examining it more closely, I have never come across such solutions on the part of the developer, although I often see an ordinary user. I think this system is a definite plus! And there is control over the input data, which means some sort of systematization, and screwing up your design is not a problem. Gorgeous, in one word! : D - Spirit
      • In this code, undoubtedly, everything is correct so that you can agree with the answer - igolka97

      MS Outlook is a great thing for large companies, it is not convenient for home use. At our company, all mail goes through Outlook, everything is integrated into the work network.

      "In general, they use php to send the form from the site and without any email programs ..." This is for feedback. Not always suitable, because for frequent many you need to have a copy of what you sent.

        mailto in principle can sometimes be useful to those who use an email client.

        Convenience is that mailto automates the process of writing a message subject, multiple recipients, etc.