복붙노트

PHP에서 메일 보내기

PHP

PHP에서 메일 보내기

자체 메일 서버를 통해서 이메일을 보내는 방법입니다.
지메일로 보내시려면 http://cnpnote.tistory.com/entry/php%EB%A1%9C-gmail-%EB%B3%B4%EB%82%B4%EA%B8%B0 를 참조하세요.

function send_mail($from, $to, $subject, $message){  
$charset='UTF-8';  
$headers = 'From: webmaster@example.com' . "\r\n" .  
'Reply-To: webmaster@example.com' . "\r\n" .  
'X-Mailer: PHP/' . phpversion();  

mail($to, $subject, $message, $headers);  
}  

// 사용하기  
$to      = 'to_usr_name@example.com';  
$subject = '제목';  
$message = '안녕';  


'PHP' 카테고리의 다른 글

PHP 데이터베이스 row 갯수 세기  (0) 2017.11.19
PHP 문자열 이어붙이기  (0) 2017.11.18
php 업로드 용량 설정 변경  (0) 2017.11.17
php로 gmail 보내기  (0) 2017.11.17
PHP URL rewrite 구현해보기  (0) 2017.11.16