顯示具有 gmail 標籤的文章。 顯示所有文章
顯示具有 gmail 標籤的文章。 顯示所有文章

2012年2月3日

GMail作為Ubuntu Linux的SMTP主機

終於找到此作者blog有詳細的介紹,不用自己架mail server,用Gmail來幫忙發信


dpkg-reconfigure exim4-config

出現設定畫面後,開始如下步驟完成設定:

1.選擇「mail sent by smarthost; received via SMTP or fetchmail」
2.輸入伺服器的網域名稱:gmail.com
3.接著「listen on for incoming SMTP connections」設定為127.0.0.1 (僅允許本地端連線)
4.將「Other destinations for which mail is accepted」設定保留空白
5.將「Machines to relay mail for」設定保留空白
6.將「Machine handling outgoing mail for this host (smarthost)」設定為smtp.gmail.com::587 (重要)
7.「hide local mail name in outgoing mail」選擇No
8.「don’t keep number of DNS-queries minimal (Dial-on-Demand)」選擇No
9.選擇「mbox」
10.「split configuration into small files」選擇No
11.接下來,編輯 /etc/exim4/passwd.client 加入帳號及密碼設定,格式如下。

*:username:password(你自己的gmail帳密)


確定exim4服務是否啟動 netstat -tlnup
若無則 /etc/init.d/exim4 start 

2011年7月20日

wordpress MU用gmail發註冊認證信

1.修改var/www/wordpress/wp-includes/pluggable.php
  將$phpmailer->IsMail(); 改為 $phpmailer->IsSMTP();

2.修改var/www/wordpress/wp-includes/class-phpmailer.php

 /**
   * Sets the SMTP hosts.  All hosts must be separated by a
   * semicolon.  You can also specify a different port
   * for each host by using this format: [hostname:port]
   * (e.g. "smtp1.example.com:25;smtp2.example.com").
   * Hosts will be tried in order.
   * @var string
   */
  public $Host          = 'smtp.gmail.com';
  public $Port          = 465;
  public $SMTPSecure    = 'ssl';
  public $SMTPAuth      = true;

  public $Username      = 'yourname@gmail.com';
  public $Password      = 'yourpasswd';