windows的php环境下使用sendmai的smtp功能l的简单配置
来源:互联网 发布:大数据时代的阅读答案 编辑:程序博客网 时间:2024/06/11 15:58
在一些场景下(最常见的就是注册账号时需要发送邮箱验证)需要使用到邮件发送功能,此时可以通过sendmail(一个邮件传输代理程序)实现。值得一提的是windows下的的配置和Linux下配置方法不同,虽然一般服务器都是部署在linux上,但也存在有和本人一样喜欢在windows下写代码调试的人
一、下载
配置之前,可以在网上自行搜索下载sendemail,懒一点的同学可以通过我的百度云下载
链接:http://pan.baidu.com/s/1slaUmpZ 密码:sq7y
解压后建议将sendmail文件夹放在php的目录下
二、邮箱设置
在本文中,我就以163邮箱作为例子,好像163邮件默认是开启smtp服务的所以不用设置,其他邮箱如果不是默认开启的话可以通过网页登录邮箱后点击设置里面开启。(pop3和imap都是收信的协议,这里不是必须开启的)
三、php.ini的主要配置
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
sendmail_path ="D:\fwq\php7\sendmail\sendmail.exe -t" 这个地方填写的就是你自己文件夹解压后sendmail.exe的地址
四、sendmail.ini的配置
; log smtp errors to error.log (defaults to same directory as sendmail.exe)
; uncomment to enable logging
error_logfile=error.log 建议开启 以用于检测
; create debug log as debug.log (defaults to same directory as sendmail.exe)
; uncomment to enable debugging
;debug_logfile=debug.log
; if your smtp server requires authentication, modify the following two lines
auth_username=
auth_password=
这里填写你邮箱的账户密码
smtp_server=smtp.163.com 这个按照你的邮箱来定(也是在邮箱的设置地址里面看)
force_sender= 这里还是填写邮箱账户
之后再使用php的Mail()类或者其他扩展类即可,若未发送成功可看错误日志,也要注意一下是否被当做垃圾邮件。
- windows的php环境下使用sendmai的smtp功能l的简单配置
- Windows下Memcache环境的搭建及简单使用(包含 APACHE+PHP+MYSQL 环境配置 )
- sendmai和dovecot的简单邮件服务器
- Windows下PHP环境的配置
- Windows下nginx+php环境的配置
- windows下的PHP环境配置
- php在windows下的环境配置
- 怎样扩展PHP的其它功能(windows环境下)
- 怎样扩展PHP的其它功能(windows环境下)
- windows下make使用的环境配置
- windows环境下Php开发环境的配置
- Windows 下 PHP 环境的配置 (原创)
- PHP运行环境在Windows下的配置
- Windows下Apache+PHP+Mysql环境的相关配置总结
- Windows环境下配置php的curl扩展
- Windows环境下配置php的curl扩展
- Windows下的PHP开发环境配置及常见问题解决
- windows环境下php配置memcache的具体操作步骤
- 实用!开发者的 Vim 插件(二)
- 实现简单的多选下拉"spinner"
- sqlite3_column_blob()自己理解
- VBS深入CreateObject函数
- proc(1)
- windows的php环境下使用sendmai的smtp功能l的简单配置
- C语言数组作为函数参数
- 约瑟夫问题
- Hibernate延迟加载详解
- Ubuntu可以随便升级内核了
- JS原型与原型链终极详解
- 【数据结构与算法】统治世界的十大算法
- hdu 3625 Examining the Rooms(斯特林数)
- less基础入门一