You must Sign In to post a response.
  • Category: HTML

    Open up mail option from html

    Hi All,
    I have one requirement, when I click my anchor tag it should open list of mail option such as outlook, gmail and etc... Below is my code but it's not working. What is wrong with this code and Is there any other options are available? Please provide your suggestion on this.

    <a style="text-decoration: underline;" ref="mailto:simiyon@gmail.com">mailto:simiyon@gmail.com</a>

    Thanks,
    Simiyon A
  • #767260
    Hi,
    First up'all make it 'href' instead of just 'ref'.
    Then Gmail uses loads of Ajax, and uses the anchor in the URL for navigation. So in order for anchors to work, a string is of smae email id is added to the anchor text, both in the link and the anchor.
    try this:

    <a style="text-decoration: underline;" href="mailto:simiyon@gmail.com">mailto:simiyon@gmail.com </a>
    <a style="text-decoration: underline;" href="mailto:simiyon@gmail.com?subject=Demo Email&body=Hi All, This is a dummy email:">mailto:simiyon@gmail.com </a>

  • #767266
    When you use 'mailto' clause, it will open default mail sender of your machine, say I have installed outlook on my machine and when I fire 'mailto' from html it will open outlook new mail window, with parameters that I have send from mailto .
    so I can send To, From, Subject and Body from hyperlink and it just open you default mail sender and send all parameters, so you just need to click on send button
    see below snippet

    < a style="text-decoration: underline;" href="mailto:testFrom@gmail.com?subject=subject&body=This is test body:">mailto:testTo@gmail.com </a>

    Thanks
    Koolprasd2003
    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]


  • Sign In to post your comments