Windows下wamp sever+sendmail使用mail()函数时的配置
来源:互联网 发布:南山铝业数据 编辑:程序博客网 时间:2024/06/07 15:44
我在自己的Windows 7系统下安装了wampserver服务器,但是使用mail()函数发送邮件时却报错了,于是在网上看了mail()函数的手册和相关信息,发现可以使用很多方法实现php脚本发送邮件,暂时记录一个比较简单的:
1,下载sendmail.zip 地址:http://glob.com.au/sendmail/;
2,解压缩sendmail.zip到sendmail文件夹,并将该文件夹移动到c:\wamp\下;
3,打开php.ini,可先打开wamp,点击其图标php->php.ini找到该文件,打开即可,在里面搜索到
describe1:
[mail function]; For Win32 only.; http://php.net/smtp;SMTP = localhost; http://php.net/smtp-port;smtp_port = 25; For Win32 only.; http://php.net/sendmail-from;sendmail_from = you@yourdomain
ps:请注意上面这些内容全部需要用;号注释掉!
describe2:
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").; http://php.net/sendmail-pathsendmail_path ="C:\wamp\sendmail\sendmail.exe -t"
ps:上面这行填写的是sendmail的路径,将其告知php解析器
describe3:
; 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(), even in safe mode.;mail.force_extra_parameters =; Add X-PHP-Originating-Script: that will include uid of the script followed by the filenamemail.add_x_header = On; Log all mail() calls including the full path of the script, line #, to address and headers;mail.log =
ps:以上(除了“mail.add_x_header = On”外),其余的也都要用;注释掉的!
4,在c:\wamp\sendmail\目录下找到sendmail.ini这个文件并打开,如下几个地方一定要修改,其他默认的地方不变即可:
smtp_server=SMTP服务器(例如smtp.qq.com或者smtp.163.com)auto = use SSL for port 465, otherwise try to use TLS(去掉他前面本来有的 ; 号,表示启用SSL)default_domain=mydomain.com变成 ;default_domain=mydomain.com(这个很重要,这个不弄的话,php不会报错,但是邮件确实发不出去!!!我尝试很久才知道)auth_username=您的邮件服务器用户名(比如XX@qq.com,注意进入相关(如qq)邮箱开启SMTP服务)auth_password=您的邮件服务器用户(授权)密码force_sender=您的邮件服务器用户名(同auth_username)
这些全部做完后,您在自己本地写好php后使用wampsever服务器和sendmail服务器就可以成功地使用mail()函数发送邮件,这在论坛设计时候的评论,反馈等方面很有用。
原文:点击打开链接
0 0
- Windows下wamp sever+sendmail使用mail()函数时的配置
- windows下用sendmail配置php的mail函数
- [转]php mail函数在win下的使用,以及配置win下的sendmail
- [转]php mail函数在win下的使用,以及配置win下的sendmail
- PHP+SendMail配置使用mail函数
- Windows下WAMP集成软件无法使用mail()函数的解决方案
- wamp下使用php的mail()函数发送邮件问题
- Linux mail命令使用和sendmail配置
- 如何在Windows系统中安装sendmail使用PHP mail()函数?
- WAMP 的简易安装配置 windows下
- linux Busybox 使用自带sendmail发送邮件以及php mail函数相应配置
- windows 10下配置 WAMP
- Linux下sendmail的配置
- Windows下php sendmail配置实现
- windows下服务器配置sendmail发邮件
- windows下wamp使用须知
- Windows下WAMP环境的多站点配置
- windows环境下配置wamp的虚拟域名
- 感慨
- Sql Server Tempdb原理-日志机制解析实践
- 最小二乘法及其python实现
- 线程的单例模式与延迟加载中的Initialization on Demand Holder
- java 国际化
- Windows下wamp sever+sendmail使用mail()函数时的配置
- linux内核细节-va_arg、va_end、va_start、printf
- C# Delegate(委托)与多线程
- mysql reinstall and restart on mac
- 【Algothrim】动态规划法实例1
- 网页元素CSS居中实现完整攻略
- Android简单自定义圆形和水平ProgressBar
- linux 中软链接的使用
- css实现正方形div的3种方式