mailto: でメールの件名や内容を設定できますか?

mailto:を使用する際に、メールの件名や内容を設定することはできますか?

ソリューション

はい、mailto: http://www.angelfire.com/dc/html-webmaster/mailto.htm ですべてのヒントとコツをご覧ください。

mailto subjectの例。

<a href="mailto:no-one@snai1mai1.com?subject=free chocolate">example</a>

mailto with content:

<a href="mailto:no-one@snai1mai1.com?subject=look at this website&body=Hi,I found this website and thought you might like it http://www.geocities.com/wowhtml/">tell a friend</a>

コメントにもあるように、subjectbody の両方を適切にエスケープしなければなりません。特定のケースのために手作業でコーディングするのではなく、それぞれに encodeURIComponent(subject) を使用してください。

コメントでHoodyが言及しているように、文字列の中に以下のエンコードされたシーケンスを追加することで、改行を追加することができます。

%0D%0A // one line break
解説 (15)
mailto:joe@company.com?subject=Your+subject
解説 (1)

はい、このようにできます。

mailto: email@host.com?subject=something
解説 (1)