drupal網站郵件發送功能的實現

來源:互聯網
上載者:User

標籤:class   c   http   a   int   com   

drupal網站可以使用gmail郵箱向使用者發送郵件,實作類別似的功能有SMTP或者PHPmailer模組,我使用的是phpmailer模組,下面是我配置的過程,貼出來供大家參考。

1、下載phpmailer模組

        http://drupal.org/project/phpmailer

2、啟用phpmailer模組,在“網站設定”點“PHPmailer”進行設定時,頁面會報錯“Class ‘PHPMailer‘ not found in ....phpmailer.class.inc”。

為什麼呢?原來phpmailer模組還需要 class.phpmailer.php  class.smtp.php  

開啟phpmailer模組下phpmailer檔案夾,檔案夾下有個COPYHERE.txt,開啟可以看一句話:
Copy the downloaded files   class.phpmailer.php  class.smtp.php   into this directory.

所以安裝模組時,需要仔細閱讀模組中的說明文檔,以減少出錯的機會。

以上兩個檔案可以去下面的連結下載:

http://sourceforge.net/projects/phpmailer/files/

 

 

 

3、ok,下載了上面需要的檔案後,就可以去配置phpmailer了 

gmail的SMTP伺服器為:smtp.gmail.com,

連接埠為: 465,這個該頁面有提示。

Use encrypted protocol(是否使用加密協議):這個選用ssl 

使用者名稱: 輸入你gmail的使用者名稱,注意這裡不要加上@gmail.com,前面的就可以了。 

密碼:就是你gmail帳號的密碼 

名稱: 郵件中寄件者的名稱

 測試郵箱地址:你可以輸入一個自己的郵箱,看看能不能收到郵件。

 

4、設定完成後,看郵箱就可以收到網站發出的郵件啦。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.