sendmail 관련 질문 드립니다 : )
우분투 서버에서 sendmail 로 메일서버를 구축하고 사용하려합니다.
메일 보내는 작업을 쉘 스크립트로 짜서 메일 테스트를 해봤습니다 .
#!/bin/bash
sender="master@test.kr"
receiver="user@gmail.com"
mailTitle="mail title"
charset="EUC-KR"
contentType="text/html"
contentDisposition="inline"
htmlDocument=$(cat /root/Test_Sendmail/test.html)
sendMail() {
sleep 1; echo 'helo SENDER'
sleep 1; echo 'mail from : '$sender
sleep 1; echo 'rcpt to : '$receiver
sleep 1; echo 'data'
sleep 1; echo 'Subject : '$mailTitle
echo 'Charset : '$charset
echo 'Content-Type : '$contentType
echo 'Content-Disposition : '$contentDisposition
echo $htmlDocument
echo '.'
}
sendMail | telnet localhost 25
이런식으로 코딩하고 실행을하면 메일이 잘갑니다.
하지만 문제는 한글인데요 .
메일 제목(Subject)에 한글이포함되면 메일발송을해도 메일이 가지가 않습니다.
그리고 메일 내용에 (지금은 html파일) 한글이 포함되면 mail from 구문까지 가지않고
텔넷이 종료되버립니다. 어떻게 해야 html파일문서에 한글이 포함되어있어도 메일이
잘 도착할 수 있을까요? ㅜㅠ 답변 부탁드립니다 !
댓글 달기