PHP 메일 기능
PHP 메일 소개
mail() 함수를 사용하면 스크립트에서 직접 이메일을 보낼 수 있습니다.
요구 사항
메일 기능을 사용하려면 PHP에 설치되어 작동하는 이메일 시스템이 필요합니다. 사용할 프로그램은 php.ini 파일의 구성 설정에 의해 정의됩니다.
설치
메일 기능은 PHP 코어의 일부입니다. 이러한 기능을 사용하기 위해 설치가 필요하지 않습니다.
런타임 구성
메일 기능의 동작은 php.ini의 설정에 의해 영향을 받습니다.
Name | Default | Description | Changeable |
---|---|---|---|
mail.add_x_header | "0" | Add X-PHP-Originating-Script that will include UID of the script followed by the filename. For PHP 5.3.0 and above | PHP_INI_PERDIR |
mail.log | NULL | The path to a log file that will log all mail() calls. Log include full path of script, line number, To address and headers. For PHP 5.3.0 and above | PHP_INI_PERDIR |
SMTP | "localhost" | Windows only: The DNS name or IP address of the SMTP server | PHP_INI_ALL |
smtp_port | "25" | Windows only: The SMTP port number. For PHP 4.3.0 and above | PHP_INI_ALL |
sendmail_from | NULL | Windows only: Specifies the "from" address to be used when sending mail from mail() | PHP_INI_ALL |
sendmail_path | "/usr/sbin/sendmail -t -i" | Specifies where the sendmail program can be found. This directive works also under Windows. If set, SMTP, smtp_port and sendmail_from are ignored | PHP_INI_SYSTEM |
PHP 메일 기능
Function | Description |
---|---|
ezmlm_hash() | Calculates the hash value needed by EZMLM |
mail() | Allows you to send emails directly from a script |