PHP用mail或pear mail发送邮件(window/linux)

本文章来给各位同学介绍一下PHP用mail或pear mail发送邮件(window/linux),有需要了解学习的同学可进入参考哈

一 、windows sendmail

http://glob.com.au/sendmail/

二、windows smtp 服务器

http://msdn.microsoft.com/zh-cn/library/8b83ac7t(v=vs.80).aspx

解决 WIN7 SMTP 安装问题,有人说WIN7系统没有SMTP服务 怎么可能呢,具体安装步骤如下:控制面板/程序>打开和关闭Windows功能,Internet信息服务  将 万维网服务>应用程序开发功能>.NET扩展性 勾上 安装 就可以了.

php mail()函数在windows不能用

php mail()函数在windows不能用,需要安装sendmail。Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in

1.从http://glob.com.au/sendmail/下载sendmail.zip

2.解压到C:下,例如C:/PHP/sendmail,最好短路径,长路径名有可能产生问题。

3.修改php.ini如下

sendmail_path = "C:/PHP/sendmail/sendmail.exe -t"

4.根据你自己的配置环境修改sendmail.ini。

第一次最好启用debug.log_file,error_logfile,以查看sendmail是否生效。

5.重启apache

用sendmail结合其它的smtp服务器,如smtp.airmb.com来实现发邮件。现在大部分邮箱都要求smtp验证,所以要在sendmail.ini中加入用户名和密码。

php.ini配置 (以用airmb.com邮箱为例)

  1. [mail function]  
  2.  ; For Win32 only.  
  3.  SMTP = smtp.airmb.com  
  4.  smtp_port = 25  
  5.  ; For Win32 only.  
  6.  sendmail_from = facai@airmb.com  
  7.  ; For Unix only. You may supply arguments as well (default: “sendmail -t -i”).  
  8. sendmail_path = “C:/PHP/sendmail/sendmail.exe -t” 

就配置三项,smtp、smtp_port和sendmail_path

sendmail.ini配置

  1. [sendmail]   
  2.  ; you must change mail.mydomain.com to your smtp server  
  3.  smtp_server=smtp.airmb.com  
  4.  smtp_port=25  
  5.  auth_username=yourusername  
  6.  auth_password=yourpassword  
  7.  force_sender=facai@airmb.com  
  8.  ; default_domain=mydomain.com 

同时在虚拟主机的conf里加上这样一句

php_admin_value sendmail_path  'C:/PHP/sendmail/sendmail.exe -t facai@airmb.com'

此邮件地址为用户的邮件地址,随便添。

注意,经测试,结果如下 : 发送成功 ,表示已发到邮件服务器队列!但邮件服务器没有启动!

运行: service sendmail start

另外 ,已发送成功的邮件,sendmail服务器会一直保存 ! 启动邮件服务器后 ,所有未发送的都会发送.

波比源码 – 精品源码模版分享 | www.bobi11.com
1. 本站所有资源来源于用户上传和网络,如有侵权请邮件联系站长!
2. 分享目的仅供大家学习和交流,您必须在下载后24小时内删除!
3. 不得使用于非法商业用途,不得违反国家法律。否则后果自负!
4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
5. 如有链接无法下载、失效或广告,请联系管理员处理!
6. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
7. 本站源码并不保证全部能正常使用,仅供有技术基础的人学习研究,请谨慎下载
8. 如遇到加密压缩包,请使用WINRAR解压,如遇到无法解压的请联系管理员!

波比源码 » PHP用mail或pear mail发送邮件(window/linux)

22 评论

  1. how to write an essay about my family arava 10mg pills azulfidine brand

  2. benicar 20mg over the counter order benicar pill buy divalproex 250mg for sale

  3. ivermectin for humans best ed drugs deltasone 40mg uk

发表评论

Hi, 如果你对这款模板有疑问,可以跟我联系哦!

联系站长
赞助VIP 享更多特权,建议使用 QQ 登录
喜欢我嘛?喜欢就按“ctrl+D”收藏我吧!♡