这2天一直在解决drupal发送邮件的问题,最初安装的时候是下载了Drupal的phpmailer和SMTP两个模块来安装,结果总是出现这样或者那样的错误,基本都是提示找不到class文件的Fatal error: Cannot redeclare drupal_mail_wrapper() (previously declared in C:\web\service portal\sites\all\Modules\phpmailer-6.x-2.1\phpmailer\phpmailer.module:56) in C:\web\service portal\sites\all\Modules\smtp-6.x-1.0-beta3\smtp\smtp.module on line 675,这个错误只是其中一个而已。
一直找不到问题在那里,就放弃了。今天又重新看了看一些资料,更重要的是看了README.txt文件,我郁闷坏了!犯了一个简单的愚蠢的错误,在Drupal提供的module中有一个模块就叫做:phpmailer,实际上真正需要的是phpmailer library,这两个完全不一样。我用的这个方法使用phpmailer模块就够用了,不需要SMTP模块。那么下面就简单将步骤说一下吧:
1,下载工具phpmailer module
http://drupal.org/project/phpmailer phpmailer libary(模块需要这个文件里面的两个class文件的支持)
三选一:
http://sourceforge.net/project/showfiles.php?group_id=26031http://sourceforge.net/projects/phpmailer/http://phpmailer.codeworxtech.com/(我用这个链接下载的)
2,安装解压刚才下载的两个文件,将phpmailer文件(注意大小写)放到durpal/sites/all/modules/下面,然后在,然后打开phpmailer这个模块文件,看到有一个子文件夹phpmailer,这个子文件夹下有一个文本文件COPYHERE.txt ,打开看到这样的一句话:
Copy the downloaded files class.phpmailer.php class.smtp.php into this directory.
提示需要class.phpmailer.php class.smtp.php这两个class文件;解压第一步中说的第二个文件(PHPMailer_v5.1.zip);在这个文件里面找到需要的两个class文件,然后复制到drupal/sites/all/modules/phpmailer/phpmailer/这个文件下(刚才提到的phpmailer的子文件夹)。
ok,已经安装好了。
3,配置以管理员身份登录Drupal,打开Administrator->site configuration->PHPMailer,我使用的gmail提供的smtp服务,phpmailer也推荐使用gmail;
* SMTP server: smtp.gmail.com
* SMTP port: 465
* Secure protocol: SSL
* Username: <your google mail name>@gmail.com
* Password: <your google mail password>下面是SMTP的设置:
ok,最后面那个test邮箱,自己随便填写一个,测试一下吧!
…………………………………………………………………………………………………………
作者:hsiao
原创文章,转载请注明出处。
本文地址:http://hi.baidu.com/yxiaoyxiao/blog/item/1c44ec03973739e609fa9333.html
…………………………………………………………………………………………………………
- 大小: 45.2 KB
- 大小: 55.2 KB
分享到:
相关推荐
drupal6邮箱配置和简洁链接设置
Drupal 如何配置CAPTCHA模块; Captcha模块用于表单验证码的配置,开启即可在发表留言,发布文章,用户注册等行为上加载验证码安全校验。
主要为大家介绍了drupal中创建hook_user并调用drupal的mail函数发送email实现方法,涉及hook函数的用法及mail函数的调用方法,需要的朋友可以参考下
包含:Drupal7宝典; Drupal开发指南; Using Drupal(强烈推荐) 值得你下载!
mac电脑在xampp环境下搭建drupal使用的.htaccess配置文件,下载后将文件名改为.htaccess放在网站根目录即可。 如果网站不在根目录则放在对应级别的目录下 并修改htaccess文件119行和123行,将119行RewriteBase /...
drupal7 vs drupal6 详细的列出了从drupal6升级到drupal7所做的一些改动。 从代码,配置,UI,API等全方面的诠释drupal7与drupal6 的不同之处。
Drupal dataDrupal data
"Enterprise Drupal 8 Development: For Advanced Projects and Large Development Teams" English | ISBN: 1484202546 | 2017 | 309 pages | PDF | 9 MB Successfully architect a Drupal 8 website that scales ...
Drupal(CMS)配置文档,主要是配置Drupal+php+iis+mysql
Decoupled Drupal in Practice: Architect and Implement Decoupled Drupal Architectures Across the Stack By 作者: Preston So ISBN-10 书号: 1484240715 ISBN-13 书号: 9781484240717 Edition 版本: 1st ed. ...
drupal6的安装,drupal6的安装drupal6的安装drupal6的安装
Beginning Drupal 8 teaches you how to build, maintain, and manage Drupal 8-based web sites. The book covers what Drupal is, using Drupal when building a new web site, installing and configuring Drupal...
drupal6 下的 mime模块, 专门用来发送html格式的电子邮件!
Ideal for experienced Drupal developers, this book takes you through RWD basics and shows you how to build sites based on Aurora, Zen, and Omega—three popular base themes created by Drupal ...
Write a Drupal 8 module with custom functionality and hook into various extension points Master numerous Drupal 8 sub-systems and APIs Model, store, and manipulate data in various ways and for various...
零起点学习Drupal教程零起点学习Drupal教程零起点学习Drupal教程
Drupal是一个开源的内容管理系统(CMS)平台,它是用PHP写成的。Drupal有一个优秀的模块化结构,提供了...日期类型配置页面上的短和中日期格式的默认值现在是正确的;文件验证错误消息现在在后续上传有效文件后被删除。
Drupal 7 高级开发第三版 Drupal7专业开发指南