메일투:를 사용할 때 이메일의 제목/내용을 설정할 수 있나요?
예, 메일로 모든 팁과 요령을 확인하세요: http://www.angelfire.com/dc/html-webmaster/mailto.htm
메일 제목 예제:
<a href="mailto:[email protected]?subject=free chocolate">example</a>
콘텐츠가 포함된 메일토:
<a href="mailto:[email protected]?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>
주석에서 언급했듯이 'subject'와 'body'는 모두 올바르게 이스케이프되어야 합니다. 특정 경우에는 수작업으로 코딩하지 말고 각각에 encodeURIComponent(subject)
를 사용하세요.
Hoody]1가 댓글에서 언급했듯이 문자열에 다음과 같은 인코딩된 시퀀스를 추가하여 줄 바꿈을 추가할 수 있습니다:
%0D%0A // one line break
<a href="mailto:[email protected]?subject=Feedback for
webdevelopersnotes.com&body=The Tips and Tricks section is great
&[email protected]
&[email protected]">Send me an email</a>
이 코드를 설정할 수 제목, 본문, cc, bcc 사용할 수 있습니다.
[Rfc 2368] 에 정의된 uirl 구성표는 mailto '이' (https://tools.ietf.org/html/rfc2368). 또한, 이 규칙은 인코딩입니다 [rfc 1738년 에 정보를 url 과 uri 가 정의되어] (https://tools.ietf.org/html/rfc1738) 및 다음 [rfc 3986] (https://www.ietf.org/rfc/rfc3986.txt). 이러한 방법에 따라 '몸' 와 '수도' 로 포함시키십시오 헤더도 URL (URI):
mailto:[email protected]?subject=current-issue&body=send%20current-issue
특히, 이메일 주소, 주제, 퍼센트 인코딩 합니다 (body) 와 같은 형식으로 저장하십시오. 그러나 이 텍스트는 법적고지 퍼센트 인코딩 html 에서 사용할 수 있는 'href 속성을 사용할 수 있도록 인코딩되지 엔티티에는 uirl 합니다 [html4 표준] 에 따르면' (https://www.w3.org/TR/html4/charset.html # h-5.3.2):
<a href="mailto:[email protected]?subject=current-issue&body=send%20current-issue">Send email</a>
그리고 가장 일반적으로 슬라이드에서는 간단한 PHP 스크립트입니다 호스트당 인코딩합니다 위의.
<?php
$encodedTo = rawurlencode($message->to);
$encodedSubject = rawurlencode($message->subject);
$encodedBody = rawurlencode($message->body);
$uri = "mailto:$encodedTo?subject=$encodedSubject&body=$encodedBody";
$encodedUri = htmlspecialchars($uri);
echo "<a href=\"$encodedUri\">Send email</a>";
?>
추가된 mailto 명령 중 하나를 사용하여 다음과 같은 방법으로 주제라서요 추가할 수 있습니다. 주제라서요 아웃해야 mailto 다운스트림에서 mailto 태그이고, 추가?
<a href="mailto:[email protected]?subject=testing out mailto">First Example</a>
또한 텍스트 추가 본문에 메시지일까요 추가하기만 & 바디입니다 태그번호 끝까지 볼 수 있는 것처럼, 아래 예.
<a href="mailto:[email protected]?subject=testing out mailto&body=Just testing">Second Example</a>
또한, cc, 또는 유형 외에 또 다른 사용자는 바디입니다 & & bcc 칠하려면 아웃해야 c&c · BCC 보다 작은 자연수이다.
<a href="mailto:[email protected]?subject=testing out mailto&body=Just testing&[email protected]&[email protected]">Third
Example</a>
내가 만든 오픈 소스 툴을 사용할 수 있는 이렇게 간편해집니다. # 39 를 문장열 운영까지도 및 you& 내려받습니다 ',' ll 즉시 mailto:
>. & # 128140 템플리트를 에서 mailto 전체 이메일.
다음은 트릭 http://neworganizing.com/content/blog/tip-prepopulate-mailto-links-with-subject-body-text
<a href="mailto:[email protected]?subject=Your+tip+on+mailto+links&body=Thanks+for+this+tip">tell a friend</a>
내가 조금 더 읽을 수 있도록 여러 줄로 나누면.
<a href="
mailto:[email protected]
?subject=My+great+email+to+you
&body=This+is+an+awesome+email
&[email protected]
&[email protected]
">Click here to send email!</a>
참고로 메시지 본문, HTML 로 사용할 수 없습니다 따르면 RFC 2368:
>. 특수 하나미 " body"; ap 는 메시지 바디입니다 하발루 나타냅니다. 이 " body"; 첫 번째 메시지의 text / plain 하나미 컨텐트입니다 바디입니다 일부를 포함해야 합니다. 실제로 이 mailto uirl 주로 세대 문자메시지 않는비즈니스 컨텐트에서 자동 처리 (" 같은 subscribe"; mime 시체들이요 아닌 일반 메시지를 메일링 리스트)
<! - begin 스니핏: js 숨기십시오: 거짓값 콘솔: 진정한 바벨. > 거짓값 -;
function generate() {
var email = $('#email').val();
var subject = $('#subject').val();
var body = $('#body').val();
var mailto = 'mailto:' + email;
var params = {};
if (subject) {
params.subject = subject;
}
if (body) {
params.body = body;
}
if (params) {
mailto += '?' + $.param(params);
}
var $output = $('#output');
$output.val(mailto);
$output.focus();
$output.select();
document.execCommand('copy');
}
$(document).ready(function() {
$('#generate').on('click', generate);
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input type="text" id="email" placeholder="email address" /><br/>
<input type="text" id="subject" placeholder="Subject" /><br/>
<textarea id="body" placeholder="Body"></textarea><br/>
<button type="button" id="generate">Generate & copy to clipboard</button><br/>
<textarea id="output">Output</textarea>
끝 - < 스니핏 >;!
컨텐츠를 추가할 경우 html 전자 메일 메시지 본문 및 url 링크를 html 코드를 인코딩합니다 포함시켜야 mailto 암호라고 너회가 can& 문제가 유형 설정, t # 39 에서 e-메일에는 이 링크는 텍스트 링크를 html 이메일 클라이언트, html 로 메일 클라이언트를 사용하여 그들의 요구를 전송하십시오 기본적으로. 다음은 코드 테스트하려면 경우 단순 mailto 링크 링크 (url 을 추가로 가시도로 각 스타일) 의 이미지와 함께 랩된.
<a href="mailto:?body=%3Ca%20href%3D%22{{ scope.url }}%22%3E%3Cimg%20src%3D%22{{ scope.url }}%22%20width%3D%22300%22%20%2F%3E%3C%2Fa%3E">
Html 태그가 uirl 인코딩입니다.