Skip to main content
Participating Frequently
October 13, 2020
Answered

How to create email link with subject and body text?

  • October 13, 2020
  • 3 replies
  • 4798 views

Here’s the email link presently my homepage. It creates an email with the subject line “Please Help Me With My Resume!"

 

<strong style="margin:18px;"><a href="mailto:jim@cheapfastresumes.com?subject=Please Help Me With My Resume!">jim@cheapfastresumes.com</a></strong>

 

 

Does anybody know how to have the link ALSO insert this text into the email BODY?

 

 

Hi!

 

Please attach your resume to this email and send it to me.

 

Also answer these 3 questions:

 

(a) Is your resume up-to-date? If not, how many more recent jobs do we need to add?

 

(b) What kind of job are you looking for now?

 

(c) What is your cellphone #? (I will send you a helpful text message.)

 

 

 

Thanks

    This topic has been closed for replies.
    Correct answer Ben M

    Why don't you use an actual form processor instead of a mailto link?  There are plenty of plugins available to help with the form setup or you can just use a service for your forms like Hubspot (https://hubspot.com ), Typeform ( https://www.typeform.com ) , Cognito Forms ( https://www.cognitoforms.com ).

     

    To answer your question though, yes you can do it with &body= after your subject line but to get the formatting you desire that will be complicated because your string must be encoded to produce the desired result otherwise it would just be one long string of text.

    3 replies

    Nancy OShea
    Community Expert
    Community Expert
    October 13, 2020

    MAILTO links have another nasty side effect.  Robots, spoofers & spammers will harvest your e-mail address and use it for their own purposes.  That's guaranteed.  Eventually your e-mail address and possibly your domain will be blacklisted for spamming -- even though you had no knowledge of it.  

     

    You can't afford that risk.   Do the safe and secure thing.  Get a scripted contact form that supports attachments and sanitizes data before it ever lands on your server.

     

    Start with your web host.  Ask them which form-to-email processing scripts they recommend you use.   This one on GitHub uses PHP code.

    https://github.com/PHPMailer/PHPMailer

     

    Nancy O'Shea— Product User & Community Expert
    Legend
    October 13, 2020

    Be interesting to see if a bot can/could crack the below:

     

    const email = document.querySelector('.email');

    const sendTo = 'emzailadzdrezss@sozmezwherze.czozm';
    email.href = `mailto:${sendTo.replace(/z/g, '')}`;

    Nancy OShea
    Community Expert
    Community Expert
    October 13, 2020

    If an 8 year old can decipher your obfuscation pattern, some bots will too. 

     

    Nancy O'Shea— Product User & Community Expert
    Legend
    October 13, 2020

    I agree with the other 2 responses - the mailto: link is the last option you should be using. If you did or do you could also make the process look more professional by using 'javascript prompts' to asked the 3 questions, which will automatically generate the body of the mailto: function fully filled in and ready to send.

    Ben MCommunity ExpertCorrect answer
    Community Expert
    October 13, 2020

    Why don't you use an actual form processor instead of a mailto link?  There are plenty of plugins available to help with the form setup or you can just use a service for your forms like Hubspot (https://hubspot.com ), Typeform ( https://www.typeform.com ) , Cognito Forms ( https://www.cognitoforms.com ).

     

    To answer your question though, yes you can do it with &body= after your subject line but to get the formatting you desire that will be complicated because your string must be encoded to produce the desired result otherwise it would just be one long string of text.

    Jon Fritz
    Community Expert
    Community Expert
    October 13, 2020

    I agree, mailto links should never be used on today's internet.

    If you don't care about your email address being harvested for spam (which it will be) the biggest issue most have is: if the user has no email client installed on their device, nothing happens when they click and you have what appears to be a broken website. Anyone who uses a browser based email portal will experience a broken link when they try to contact you. Not an ideal way to gain viewer confidence.

    That being said, it's actually pretty simple to add a new line within the link code...

    %0d%0a

    So something along these lines would work for your email-client-installed-in-system viewers...

    <strong style="margin:18px;"><a href="mailto:jim@cheapfastresumes.com?subject=Please Help Me With My Resume!&body=Hi!
    %0d%0a %0d%0a
    Please attach your resume to this email and send it to me.
    %0d%0a %0d%0a
    Also answer these 3 questions:
    %0d%0a %0d%0a
    (a) Is your resume up-to-date? If not, how many more recent jobs do we need to add?
    %0d%0a %0d%0a
    (b) What kind of job are you looking for now?
    %0d%0a %0d%0a
    (c) What is your cellphone #? (I will send you a helpful text message.)">jim@cheapfastresumes.com</a></strong>

     

    ...nothing will happen for the rest of your viewers.