Search code examples
htmlhtml-emailmailto

Can you pre-fill parts of an email using mailto?


I know you can use mailto: to add a subject line or CC/BCC other people, but is there a way you can add some body text, or a signature line to an email?

For example: if you wanted to have a line at the end of the email that said:

"Mailed from yoursite.com"

Just so you could know that they used a link from your site. Is this possible without using a form or a script?


Solution

  • How do you add a signature to a mailto without PHP (or equivalent)?

    While your answer was sort of vague, you could try something like this, where you write something at the top and have a few carriage returns (%0D) followed by the signature Mailed from yoursite.com. %20 can be used to ensure that the browser displays spaces correctly.

    <a href="mailto:someone@example.com?subject=Hello%20there&body=Body%20stuff%20goes%20here.%0D%0DMailed%20from%20yoursite.com">Send Mail</a>

    You can take a look at this w3 schools link or this discussion (as mentioned by Obsidian Age).