環境
- qmailインストール済
- CentOS6
# yum install httpd php php-devel php-mbstring php-pdo php-gd php-xml php-mcrypt # service httpd start # chkconfig httpd on # service iptables stop
# vi /etc/php.ini sendmail_path = /usr/sbin/sendmail -t -i ↓変更 ;sendmail_path = /usr/sbin/sendmail -t -i sendmail_path = /var/qmail/bin/qmail-inject
# service httpd restart
# vi /var/www/html/mail.php
<?php
mb_language("Japanese");
mb_internal_encoding("UTF-8");
$to = 'yuu@hoge.net';
$subject = '送っちゃうよ';
$message = '本文';
$headers = 'From: yuu@example.net' . "\r\n";
mb_send_mail($to, $subject, $message, $headers);
http://IPアドレス/mail.php




