Last active
May 6, 2016 14:19
-
-
Save kyoh86/8f80ee5dc1a9c0e2a39aaa5b7bbac120 to your computer and use it in GitHub Desktop.
PHP+postfix with Gmail on El Capitan ref: http://qiita.com/kyoh86/items/c09224660da7ed618afd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[smtp.gmail.com]:587 [email protected]:hogehogehoge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo postmap hash:/etc/postfix/sasl_passwd | |
sudo postfix reload | |
sudo postfix stop | |
sudo postfix start |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo postmap hash:/etc/postfix/sasl_passwd | |
sudo postfix reload | |
sudo postfix stop | |
sudo postfix start |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo postmap hash:/etc/postfix/sasl_passwd | |
sudo postfix reload | |
sudo postfix stop | |
sudo postfix start |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```sample.php | |
<?php | |
date_default_timezone_set('Asia/Tokyo'); | |
mb_send_mail( | |
"[email protected]", | |
"test for postfix", | |
"test for PHP+postfix with Gmail on El Capitan", | |
"From: [email protected]" | |
); | |
?> | |
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# : | |
# : 前略 | |
# : | |
# CUSTOM ######## | |
# Minimum Postfix-specific configurations. | |
mail_owner = _postfix | |
setgid_group = _postdrop | |
myhostname = smtp.gmail.com | |
relayhost=[smtp.gmail.com]:587 | |
smtp_sasl_auth_enable = yes | |
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd | |
smtp_sasl_tls_security_options = noanonymous | |
smtp_use_tls = yes | |
smtp_sasl_mechanism_filter = plain |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; | |
; 前略 | |
; | |
[mail function] | |
; For Win32 only. | |
; http://php.net/smtp | |
SMTP = smtp.gmail.com | |
; http://php.net/smtp-port | |
smtp_port = 587 | |
; For Win32 only. | |
; http://php.net/sendmail-from | |
sendmail_from = [email protected] | |
; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). | |
; http://php.net/sendmail-path | |
sendmail_path =/usr/sbin/sendmail -t -i | |
; Force the addition of the specified parameters to be passed as extra parameters | |
; to the sendmail binary. These parameters will always replace the value of | |
; the 5th parameter to mail(). | |
;mail.force_extra_parameters = | |
; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename | |
mail.add_x_header = On |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
date_default_timezone_set('Asia/Tokyo'); | |
mb_send_mail( | |
"[email protected]", | |
"test for postfix", | |
"test for PHP+postfix with Gmail on El Capitan", | |
"From: [email protected]" | |
); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment