CI 整合 Gmail SMTP 進行發信
先來筆記一下設定發信主機到 Google SMTP 的方法,只要修改 APP_PATH/config/email.php,如下:
$config['protocol'] = 'smtp'; $config['smtp_host'] = 'ssl://smtp.gmail.com'; $config['smtp_port'] = '465'; $config['smtp_timeout'] = '30'; $config['smtp_user'] = 'xxx@gmail.com'; // 填 Google App Domain Mail 也可以 $config['smtp_pass'] = 'YOUR_PWD'; $config['charset'] = 'utf-8'; $config['newline'] = "\r\n"; $config['mailtype'] = 'html'; $config['wordwrap'] = true;
筆記一下!