java script
간단한 폼메일 스크립트
디자인인스
2011. 1. 7. 11:54
// 이메일로 받는 폼메일 스크립트 입니다.
// 사용자 컴퓨터에 아웃룩 프로그램이 설치되어 있어야 합니다
// 방명록이나 건의문 등을 작성할때 사용하면 좋습니다
// [1단계] 아래의 소스코드를 <HEAD>와 </HEAD> 사이에 붙여 넣으세요 ---->
<script Language="JavaScript">
<!--
function mailIt(form) {
var data = document.dataForm
var userInfo = ""
form.action += data.recipient.value
form.action += "?subject=" + data.subject.value
userInfo += "사이트 제목 : " + document.title + "n"
userInfo += "사이트 경로 : " + document.location + "nn"
form.mailBody.value = "n" + userInfo + "n"+data.name.value + "n" + data.email.value
+ "n"+data.comments.value
return true
}
//-->
</script>
// [2단계] 아래의 코드를 원하는 위치에 복사 해 넣으세요
<table border=0 width=500 align=center cellspacing=5 cellpadding=5>
<form NAME="dataForm">
<tr>
<th ALIGN="right" bgColor=#F5F5F5>받는사람
<td bgColor=white><input NAME="recipient" SIZE="40" VALUE="help@jasko.co.kr">// 이곳에서 수신자 이메일주소를 수정하세요
</tr>
<tr>
<th ALIGN="right" bgColor=#F5F5F5>제 목
<td bgColor=white><input NAME="subject" SIZE="40" VALUE="안녕하세요">
</tr>
<tr>
<th ALIGN="right" VALIGN="top" bgColor=#F5F5F5>보내는 사람 이름
<td bgColor=white><input NAME="name" SIZE="40" VALUE>
</tr>
<tr>
<th ALIGN="right" VALIGN="top" bgColor=#F5F5F5>보내는 사람 Email
<td bgColor=white><input NAME="email" SIZE="40" VALUE>
</tr>
<tr>
<th ALIGN="right" VALIGN="top" bgColor=#F5F5F5>내 용
<td bgColor=white><textarea NAME="comments" cols="40" rows=10></textarea>
</tr>
</form>
<form NAME="mailForm" ACTION="mailto:" METHOD="post" ENCTYPE="text/plain" onSubmit="return mailIt(this)">
<input TYPE="hidden" NAME="mailBody" VALUE="JASKO Web Mail"><br>
<tr>
<td COLSPAN="2" ALIGN="center" bgColor=white>
<input TYPE="submit" VALUE="보내기">
</tr>
</form>
</table>
<!---->
// 사용자 컴퓨터에 아웃룩 프로그램이 설치되어 있어야 합니다
// 방명록이나 건의문 등을 작성할때 사용하면 좋습니다
// [1단계] 아래의 소스코드를 <HEAD>와 </HEAD> 사이에 붙여 넣으세요 ---->
<script Language="JavaScript">
<!--
function mailIt(form) {
var data = document.dataForm
var userInfo = ""
form.action += data.recipient.value
form.action += "?subject=" + data.subject.value
userInfo += "사이트 제목 : " + document.title + "n"
userInfo += "사이트 경로 : " + document.location + "nn"
form.mailBody.value = "n" + userInfo + "n"+data.name.value + "n" + data.email.value
+ "n"+data.comments.value
return true
}
//-->
</script>
// [2단계] 아래의 코드를 원하는 위치에 복사 해 넣으세요
<table border=0 width=500 align=center cellspacing=5 cellpadding=5>
<form NAME="dataForm">
<tr>
<th ALIGN="right" bgColor=#F5F5F5>받는사람
<td bgColor=white><input NAME="recipient" SIZE="40" VALUE="help@jasko.co.kr">// 이곳에서 수신자 이메일주소를 수정하세요
</tr>
<tr>
<th ALIGN="right" bgColor=#F5F5F5>제 목
<td bgColor=white><input NAME="subject" SIZE="40" VALUE="안녕하세요">
</tr>
<tr>
<th ALIGN="right" VALIGN="top" bgColor=#F5F5F5>보내는 사람 이름
<td bgColor=white><input NAME="name" SIZE="40" VALUE>
</tr>
<tr>
<th ALIGN="right" VALIGN="top" bgColor=#F5F5F5>보내는 사람 Email
<td bgColor=white><input NAME="email" SIZE="40" VALUE>
</tr>
<tr>
<th ALIGN="right" VALIGN="top" bgColor=#F5F5F5>내 용
<td bgColor=white><textarea NAME="comments" cols="40" rows=10></textarea>
</tr>
</form>
<form NAME="mailForm" ACTION="mailto:" METHOD="post" ENCTYPE="text/plain" onSubmit="return mailIt(this)">
<input TYPE="hidden" NAME="mailBody" VALUE="JASKO Web Mail"><br>
<tr>
<td COLSPAN="2" ALIGN="center" bgColor=white>
<input TYPE="submit" VALUE="보내기">
</tr>
</form>
</table>
<!---->