本文章来给各位同学介绍一下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邮箱为例)
- [mail function]
- ; For Win32 only.
- SMTP = smtp.airmb.com
- smtp_port = 25
- ; For Win32 only.
- sendmail_from = facai@airmb.com
- ; For Unix only. You may supply arguments as well (default: “sendmail -t -i”).
- sendmail_path = “C:/PHP/sendmail/sendmail.exe -t”
就配置三项,smtp、smtp_port和sendmail_path
sendmail.ini配置
- [sendmail]
- ; you must change mail.mydomain.com to your smtp server
- smtp_server=smtp.airmb.com
- smtp_port=25
- auth_username=yourusername
- auth_password=yourpassword
- force_sender=facai@airmb.com
- ; default_domain=mydomain.com
同时在虚拟主机的conf里加上这样一句
php_admin_value sendmail_path 'C:/PHP/sendmail/sendmail.exe -t facai@airmb.com'
此邮件地址为用户的邮件地址,随便添。
注意,经测试,结果如下 : 发送成功 ,表示已发到邮件服务器队列!但邮件服务器没有启动!
运行: service sendmail start
另外 ,已发送成功的邮件,sendmail服务器会一直保存 ! 启动邮件服务器后 ,所有未发送的都会发送.
波比源码 » PHP用mail或pear mail发送邮件(window/linux)
levofloxacin generic order levaquin pills
order anastrozole pills cheapest way to buy viagra viagra 50mg brand
buy doxycycline 200mg without prescription purchase vardenafil generic order furosemide 40mg online cheap
salbutamol 100mcg canada purchase imuran online sildenafil next day
generic for cialis cialis 20mg oral real viagra
baclofen 10mg pill order tizanidine 2mg generic ketorolac canada
prednisone 10mg for sale minipress online buy vermox 100mg sale
order clarithromycin sale antivert 25mg sale order meclizine sale
order albuterol generic buy proventil 100 mcg for sale order cipro 500mg online cheap
buy tiotropium bromide 9mcg minocycline 100mg without prescription terazosin 1mg pill
pioglitazone 15mg drug cheap sildenafil pills order viagra 50mg pills
liquid cialis Buy branded cialis play poker online free no sign up
quick hits free online slots casino slots gambling free blackjack
best casino canadian pharmacy term papers writing
buy doxycycline for sale order cleocin without prescription cleocin pill
how to write an essay about my family arava 10mg pills azulfidine brand
buy asacol pill buy mesalamine 800mg for sale irbesartan 300mg tablet
benicar 20mg over the counter order benicar pill buy divalproex 250mg for sale
purchase lanoxin sale telmisartan 20mg for sale molnunat 200mg uk
tadacip 20mg without prescription order clopidogrel 75mg pills amoxicillin ca
accutane drug buy generic deltasone 5mg ampicillin antibiotic
ivermectin for humans best ed drugs deltasone 40mg uk