How to create a text that permit to send email in HTML document when button is clicked ? Last Updated : 29 Jul, 2024 Summarize Comments Improve Suggest changes Share Like Article Like Report In this article, we will learn How to create the text that permits sending the email in the HTML document when the button is clicked. We can simply create a form that can be used for creating the text i.e body of the message as well as it can be used for sending the email to the respective address.The action property of the form is used to specify the URL of the document where the data is to be sent after submission of the form with the help of a button. In the action property, we can define the email of the sender using the mailto link in the form of HTML. Also, we can configure the email using some other properties in the mailto link.Syntax:<form method="POST" action="mailto: [email protected]" enctype="multipart/form-data">We can also send mail in the following ways:Cc field: Cc stands for Carbon Copy. The user whose e-mail address is specified in this field will get a copy of the e-mail message. In this way, you can send a similar message to multiple users with one click. The e-mail addresses to whom the e-mail was sent will be visible to all other recipients as well. It is an optional field. You can use this field depending on your requirement. Syntax:<form action="mailto:[email protected] ? [email protected]"> Send Email</form>Bcc field:: Bcc stands for Blind Carbon Copy. The user whose e-mail address is specified in this field will get a copy of the e-mail message but the recipient's e-mail address mentioned here will not be visible to other recipients. It is an optional field. You can use this field depending on your requirement.Syntax:<form action="mailto:[email protected] ? [email protected]"> Send Email</form>Let's understand how to create a text that permits to send the email when the button is clicked using an example.Example: Creating a button for sending an email using the action attribute of the form. HTML <!DOCTYPE html> <html> <head> <title>E-mail</title> </head> <body> <h4>Click To Send An E-mail</h4> <form action="mailto: [email protected]"> Username:<br> <input type="text" name="username" placeholder="Enter Username"><br><br> Message:<br> <input type="textarea" name="message" rows="10" cols="30" placeholder="Enter your message"> <br><br> <input type="submit" value="Send Email"> </form> </body> </html> Output: Comment More infoAdvertise with us Next Article How to Create a Link to Send Email in HTML ? A annieahujaweb2020 Follow Improve Article Tags : HTML HTML-Questions Similar Reads How to Create a Link to Send Email in HTML ? Incorporating email links into HTML pages facilitates a smooth way for users to send a message directly from the webpage. We will see how to create these email links, making your web pages user-friendly and interactive.Using Mailto Protocol with Predefined SubjectTo create a link to send an email in 2 min read How to create a clickable button in HTML ? In this article, we will create a Button by using the <Button> Element in the Document. It is used to submit the content. The images and text content can use inside a button tag. Syntax: <button type = "button"> Example: Using HTML <button> type Attribute html <!DOCTYPE html> 1 min read How to create button to open SMS compose to a phone number using HTML ? Sometimes, when you search for a number on the web, you might want to SMS to it directly from the web page instead of noting it down and then messaging to it. It becomes quite convenient for the user. Making an SMS link is very easy in HTML. Here, we will see how to make the SMS link on a webpage. U 2 min read How to create button which belongs to one or more forms in HTML5 ? In HTML, the <button> tag is used to create a clickable button on your webpage. It also has a closing tag written as </button>. You can add a text or image, whatever you want to display a button, within the <button> tag. The type attribute for a <button> tag should always be 2 min read How to create a form with custom buttons in HTML ? HTML form contains other form elements like text box, check box, radio button, submit button, and many more. For creating an HTML form, <form>________</form>tag is used as it is paired tag so starting and closing tags both are required. Other form elements are placed within these tags. I 3 min read How to write e-mails in HTML and send it using Gmail ? In this article, we are going to learn that how users can write e-mails in HTML format and send them using Gmail. However, Gmail doesn't offer an HTML editor still we can send HTML templates in an e-mail using some tools and methods. Many people need to send an e-mail with HTML templates to others. 3 min read Like