How To Create Mail And Phone Link In HTML ? - GeeksforGeeks

Skip to content geeksforgeeks
  • Courses
    • DSA Courses
    • Programming Languages
  • Tutorials
    • Python Tutorial
      • Python Loops and Control Flow
    • Java
      • Java Interview Questions
      • Java Quiz
      • Advance Java
    • Programming Languages
    • System Design
    • Interview Corner
    • Computer Science Subjects
    • DevOps
    • Linux
    • Software Testing
    • Databases
    • Android
    • Excel
    • Mathematics
  • DSA
    • Data Structures
    • Algorithms
      • Analysis of Algorithms
      • Searching Algorithms
      • Sorting Algorithms
    • Practice
      • Company Wise Coding Practice
      • Practice Problems Difficulty Wise
      • Language Wise Coding Practice
      • Curated DSA Lists
    • Company Wise SDE Sheets
    • DSA Cheat Sheets
    • Puzzles
  • Data Science
    • Data Science Packages
    • Data Visualization
    • Data Analysis
  • Web Tech
    • Web Development Using Python
      • Django
      • Flask
    • Cheat Sheets
  • HTML Tutorial
  • HTML Exercises
  • HTML Tags
  • HTML Attributes
  • Global Attributes
  • Event Attributes
  • HTML Interview Questions
  • HTML DOM
  • DOM Audio/Video
  • HTML 5
  • HTML Examples
  • Color Picker
  • A to Z Guide
  • HTML Formatter
Open In App How to Create Mail and Phone Link in HTML? Last Updated : 23 Nov, 2024 Summarize Comments Improve Suggest changes Like Article Like Save Share Report Follow

The HTML provides mailto and tel attributes to create the mail and phone links. We can use them in href to create the links. The href provides other sub-attributes that define the other properties of the mailto and phone link.

Creating a Mailto Link

A mailto link is an easy way for users to contact website owners or anyone else directly from a webpage. When a user clicks on the mailto link, it opens their default email client with a new mail addressed to the specified email address. You can also prefill the subject and body text to save users time.

Syntax

<a href="mailto:EMAIL?cc=ANOTHER_EMAIL&bcc=ANOTHER_EMAIL&subject=SUBJECT&body=Demo email" target="_blank">Text_to_Show</a>

Where –

  • mailto: Accepts the recipient’s email address.
  • cc:Optional parameter. Accepts another email address that will receive the carbon copy.
  • bcc: Optional parameter. Accepts one or more email addresses that will receive the blind carbon copy.
  • subject: Allows you to assign a default subject to the mail.
  • body:Allows you to assign a default subject to the mail.
  • ?: First parameter delimiter.
  • &:Allows you to separate more than one query.
HTML <a href= "mailto:feedback@geeksforgeeks.org?cc=feedback@xyz.com&bcc=contact@xyz.org&subject=Mail to GeeksForGeeks&body=Demo email" target="_blank"> Contact at GeeksForGeeks </a>

Output

mail_output

OUtput

Creating a Phone Link

Similar to mailto links, you can also create call links using the HTML anchor tag. When a user clicks on the call link, it redirects them to their default call app with the phone number pre-filled, so they can make calls directly.

Syntax

<a href="tel:+91123-456-7890"> call US </a>

Where –

  • tel: To redirect to a call app.
  • callto: To open skype app.
  • SMS: To send a Text message.
  • fax: To send a fax.
HTML <a href="tel:+91123-456-7890"> Contact on call </a> <br /> <a href="callto:+91123-456-7890"> Contact on Skype </a> <br /> <a href="SMS:+91123-456-7890"> Send SMS </a><br /> <a href="fax:+91123-456-7890"> Send Fax </a>

Output

phone_output Comment More info Next Article How to Create an Image Map in HTML ? author shubhamvora05 Follow Improve

Similar Reads

  • How to Create Mail and Phone Link in HTML? The HTML provides mailto and tel attributes to create the mail and phone links. We can use them in href to create the links. The href provides other sub-attributes that define the other properties of the mailto and phone link. Creating a Mailto LinkA mailto link is an easy way for users to contact w 2 min read
  • How to Create an Image Map in HTML ? An image map is a graphical representation that allows you to define clickable areas (or "hotspots") within an image. Each hotspot can be associated with a hyperlink, making different parts of the image interactive. Image maps are commonly used for navigation menus, interactive diagrams, and geograp 2 min read
  • How to Create a Hyperlink in HTML? If we want to navigate from one page to another then Hyperlink comes into play. It provides you the link to navigate to another page, on hovering that link the cursor turns into a little hand. Hyperlink enables us to connect one page to another, navigate to specific sections, or even open applicatio 2 min read
  • 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. Table of Content Using Mailto Protocol with Predefined SubjectCreating Link to s 2 min read
  • How to Link an Email in HTML? In HTML, you can create links that, when clicked, open an email client with a pre-composed message. This is useful for providing contact information or encouraging users to send inquiries. To link an email in HTML, we can use the <a> tag with the mailto: protocol. This creates a clickable link 2 min read
  • How to Create Links to Other Pages in HTML ? HTML links are like pathways on the internet. They connect one webpage to another. Imagine a link as having two parts: a starting point (where you click) and an endpoint (where you end up). When you click on a link, you're basically starting at one point (the anchor) and moving to another (the desti 2 min read
  • How to Create a Download Link in HTML? A download link allows users to download a specific file when they click on it. The download attribute in HTML is used to create a download link. Using the anchor tag we can create a download link in the HTML. Using the <a> Anchor TagTo create a download link in HTML, use the <a> tag wit 1 min read
  • How to Change the Target of a Link in HTML ? In HTML, for changing the target of a link we can use the target attribute in the <a> anchor tag. This attribute mainly specifies where the linked content should be displayed. Below are the approaches that can be used to change the target link in HTML: Table of Content Using target Attribute O 3 min read
  • How to Link an Image to Another Page in HTML? To link an image to another page in HTML, you can wrap the <img> element inside an anchor (<a>) tag. When the image is clicked, it will navigate to the specified page, just like a regular hyperlink. Example of Linking an Image to Another PageHere's how you can achieve this: [GFGTABS] HTM 2 min read
  • How to Add a Subject to a Mailto link in HTML ? In HTML, to add a subject to a Mailto link, we can use the Subject as a query parameter just after the specified email address and pass the subject of the email as its value. Along with this, we can use JavaScript to add custom subjects according to the user input. Table of Content Directly adding t 3 min read
  • How to connect Skype, Mail and Phone using HTML ? Connecting to Mail: Mailto link is a default way to sending a mail when the consumer wants to communicate or wants to give feedback, then by clicking the mailto link will open a default sending mail window. So we can use mailto which direct to the mail once the form is submitted. Using mailto we can 3 min read
  • How to create a link with a media attribute in HTML5 ? The <link> media Attribute attribute specifies which media/device is being optimized for the target resource. This attribute is typically used in conjunction with CSS stylesheets to specify different styles for various media types and connecting to external stylesheets, allowing the user to se 1 min read
  • How to Link a Button to Another Page in HTML? Linking a button to another page is a common requirement in web development. It can allow the users to navigate between a website's different sections or pages. This can be done using the various HTML elements. PrerequisitesHTMLCSS1. Using <a> Tag Styled as ButtonThe <a> tag is tradition 3 min read
  • How to create a nofollow link using HTML5 ? A nofollow link s used by Google to specify that the Google search spider should not follow that link and mostly used for paid links. Nofollow links are links with a rel=”nofollow” HTML tag applied to them. The nofollow tag tells search engines to ignore that link. The nofollow links do not pass Pag 1 min read
  • How to use anchor tag to open links in HTML ? In this article, we will learn how to use anchor tags to open links in HTML and we will implement different operations using anchor tags in HTML. We will see in this article, how to redirect another website through an anchor tag and how to open a blank new tag for any new link to open an image in a 3 min read
  • How to Create Navigation Links using HTML5 ? In this article, we create a navigation link by using the <nav> tag in the document. The nav element represents a section of the page whose purpose is to provide navigational links, either in the current document or to other documents. The links in the "nav" element may point to other webpages 1 min read
  • How To Link Pages In HTML? In HTML, linking pages is the fundamental practice that allows users to navigate from one web page to the another within same website or to an entirely different website. These links, also known as hyperlinks, are created using the <a> tag, which can direct the users to another HTML document, 5 min read
  • How To Create Registeration Form in HTML HTML Registration Form is a web-based form designed to collect user information such as name, email, password, and other details. It typically includes input fields, validation, and a submit button to register users on a website. How to Create HTML Registration FormBasic Structure: A responsive regi 2 min read
  • How to embed PHP code in an HTML page ? PHP is the abbreviation of Hypertext Preprocessor and earlier it was abbreviated as Personal Home Page. We can use PHP in HTML code by simply adding a PHP tag without doing any extra work. Example 1: First open the file in any editor and then write HTML code according to requirement. If we have to a 2 min read
Article Tags :
  • HTML
  • Web Technologies
  • HTML-Attributes
  • HTML-Questions
Like three90RightbarBannerImg Explore More We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy Got It ! Lightbox Improvement Suggest changes Suggest Changes Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal. geeksforgeeks-suggest-icon Create Improvement Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all. geeksforgeeks-improvement-icon Suggest Changes min 4 words, max CharLimit:2000

What kind of Experience do you want to share?

Interview Experiences Admission Experiences Career Journeys Work Experiences Campus Experiences Competitive Exam Experiences

Từ khóa » Html Phone Link Code