문제

Im using the following mailto link to send an email:

 <a class="share3" title="" href="mailto:?subject=@check&amp;body=@domain">

It works well, but sometimes my subject will contain an ampersand (&) character, and when it does my email is created without a body.

Any way to resolve this problem?

도움이 되었습니까?

해결책

In order to get special/reserved characters into a URL, you must encode them - to get an & to work, it must be encoded to %26.

More details here: http://www.w3schools.com/tags/ref_urlencode.asp

다른 팁

use %26 for the & in the subject.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top