질문이 좀 이해가 안갑니다. 지금 문제가 없어보이시는데요?
일단 질문을 예측해서 답변 올려봅니다.
php mail()함수를 사용하는 스크립트가 있고, 로컬에 전문 mta 설치를 못하신다는 거지요?
일단 이것은 간단하게 ssmtp 라는 패키지를 이용하시면 외부 smtp 서버를 이용할수 있습니다.
보통 지메일 smtp 를 많이 이용하는데, 구글에 ssmtp 로 검색하시면 설정법이 많이 나와있습니다.
우선은 ubuntu 에서 smtp 서버를 초간단으로 잡아준다.
apt-get install ssmtp
그다음 설정 변경
cat /etc/ssmtp/ssmtp.conf
그래서 설정에 다음 내용들 추가
http://ydhoney.egloos.com/1179866
뭐 Gmail 같은 경우는 이렇게 한다더군요. - 찾다보니 나와서 설정 추가합니다.
#The following line redirects mail to root to your gmail account
root=myemail@gmail.com
mailhub=smtp.gmail.com:587
UseSTARTTLS=yes
UseTLS=yes
AuthUser=myemail@gmail.com
AuthPass=mypassword
참고 php 에서 직접 메일 보내기
http://rayis.co.kr/tag/%EB%A9%94%EC%9D%BC%EB%B3%B4%EB%82%B4%EA%B8%B0
function sendmail($name, $from, $to, $subject, $body, $html, $charset ) {
$smtp_server = "smtp.yourip.com"; //enter your smtp server here
$smtp_user = "yourusername"; //enter your smtp username here
if (!$smtp_sock = fsockopen("$smtp_server", 25)) {
die ("Couldn't open mail connection to $smtp_server! \n");
}
fputs($smtp_sock, "HELO $smtp_server\n");
fputs($smtp_sock, "VRFY $stmp_user\n");
fputs($smtp_sock, "MAIL FROM:$from\n");
fputs($smtp_sock, "RCPT TO:$to\n");
fputs($smtp_sock, "DATA\n");
fputs($smtp_sock, "From: $name<$from>\n");
fputs($smtp_sock, "X-Mailer: miplus\n");
if ($html) fputs($smtp_sock, "Content-Type: text/html;");
else fputs($smtp_sock, "Content-Type: text/plain;");
fputs($smtp_sock, "charset=$charser\n");
fputs($smtp_sock, "MIME-Version: 1.0\n");
fputs($smtp_sock, "Subject: $subject\n");
fputs($smtp_sock, "To: $to\n");
fputs($smtp_sock, "$body");
fputs($smtp_sock, "\n.\nQUIT\n");
fclose($smtp_sock);
}
$name = "보내는 사람 이름";
$from = "보내는 사람 이메일 주소";
$to = "받는 사람 이메일 주소";
$subject = "제목";
$body = "내용";
$html = "html 사용여부(1:사용, 0:사용안함)";
$charset = "UTF-8";
http://holicskr.tistory.com/tag/ubuntu
Posted by 눈빛마음

