PHP & Others

폼 그대로 메일 발송하기

페이지 정보

본문

<script>
function checkForm(form){
...이러쿵 저러쿵...
return true;
}
</script>
<form action="some.php" method="post" onsubmit="return checkForm(this);">
견적요청
<table>
<tr><td>성명</td><td><input type="text" name="m_name"></td></tr>
<tr><td>메일</td><td><input type="text" name="m_mail"></td></tr>
<tr><td>내용</td><td><input type="text" name="m_content"></td></tr>
<tr><td colspan="2"><input type=submit><input type=reset></td></tr>
</table>
</form>

폼메일 보내기는 대충 위와 같을겁니다
서버에서 request 변수 받아서 내용 다시 만들고...꾸미고...해서 메일 쏴주는데요
오늘 견적 요청 폼메일 디자인 받고는...ㅡㅡ;
그래서 그냥 통채로 쏴주기로 했습니다

<script>
function checkForm(form){
...이러쿵 저러쿵...
form.mailBody.value = form.innerHTML;
return true;
}
</script>
<form action="some.php" method="post" onsubmit="return checkForm(this);">
<input type="hidden" name="mailBody">
견적요청
<table>
<tr><td>성명</td><td><input type="text" name="m_name"></td></tr>
<tr><td>메일</td><td><input type="text" name="m_mail"></td></tr>
<tr><td>내용</td><td><input type="text" name="m_content"></td></tr>
<tr><td colspan="2"><input type=submit><input type=reset></td></tr>
</table>
</form>

서버에서는 mailBody 만 받아서, mime text/html 설정해주고
그대로 메일 쏴줬습니다
그대로 오더군요
(아참...저는 aspx 에서 requestValidate="false" 로 주고 했습니다)

관련자료

등록된 댓글이 없습니다.
Today's proverb
이슬비가 내리고 있다. 당신은 밖에 나가서 우산을 편다. 그것으로 충분하다.“구질구질하게 또 비가 오는군!” 이런 말을 한들 무슨 소용이 있는가. 비도, 구름도, 바람도 결코 마음대로 되지 않는데 어째서 “비 한번 시원스럽게 내리는군”하고 말하지 못하는가. <<날마다 행복해지는 255가지 이야기>> (알랭)