Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML HTML Basics Going Further with HTML Link to Email

Enemuo Felix
Enemuo Felix
1,895 Points

Different syntax ?

I just clicked on the two links on the Teachers Note and found out that there might be different syntax for the mailto attribute. I found this

<a href="mailto:someone@yoursite.com?cc=someoneelse@theirsite.com&bcc=lastperson@theirsite.com&subject=Big%20News&body=Body-goes-here">Email Us</a>

And this

<a href="mailto:nowhere@mozilla.org?cc=name2@rapidtables.com&bcc=name3@rapidtables.com&amp;subject=The%20subject%20of%20the%20email &amp;body=The%20body%20of%20the%20email">
  Send mail with cc, bcc, subject and body
</a>

I noticed the second one has &amp; between the bcc value and subject while the first one only has the 'and' sign. Is there any difference?

1 Answer

Yes, there's a difference. &amp; is the special character for the ampersand (&). The special character, &amp;, will still work in an email link. Check this out: https://codepen.io/mattpbrock/pen/JOXXPM.

Enemuo Felix
Enemuo Felix
1,895 Points

Thank you so much Sam, I just checked out your link. However, I noticed you might have made a mistake because your "using a special character" and "without special character" have the same syntax.