建立一个Ubuntu的/阿帕奇/ PHP机发送电子邮件 [英] Setting up a Ubuntu/Apache/PHP machine to send email
问题描述
我工作的一个小胡志明市公司,其唯一的服务器只是一老的小型计算机。现在,短短几个月后,我们正在迅速扩大和新用户的要求之一是要求他们验证他们的电子邮件地址。
I am working for a small Ho Chi Minh City company whose only server was just one old small computer. Now just a few months later, we are expanding rapidly and one of the requirements for new users is to require them to verify their email addresses.
有在Ubuntu框中没有特别的计划,而不是我实际的服务器上做的唯一的事情就是重新格式化从Windows XP整个硬盘驱动器并安装纳蒂独角鲸就可以了,然后再安装Apache和PHPMYADMIN。
There are no special programs on the Ubuntu box, instead the only thing I did on the actual server was re-format the entire hard drive from windows XP and installed Natty Narwhal on it, then install Apache and PHPMYADMIN.
我想有PHP尽快有人申请会员发出一封电子邮件给用户和管理员都。但我不知道我需要做的开始。
I would like to have PHP to send out an email to both the user and the administrators as soon as somebody applies for membership. But I have no idea what I need to do to start.
这是什么,我需要设置第一是虚心AP preciated任何想法;我不是在寻找一个有步骤,只是一些提示,指出我在正确的方向。
Any ideas on what I need to set up first would be humbly appreciated; I am not looking for a step by step, just some tips to point me in the right direction.
-Duong凡
推荐答案
命令和apt-get安装的sendmail
将安装sendmail的副本在本地监听。如果你安装了这一点,那么PHP可以使用内置的电子邮件()
功能。此外,还有不会的,如果你安装这样也成为远程继电器的风险。
sudo apt-get install sendmail
will install a copy of sendmail that listens locally. If you install that, then php can use the built in mail()
function. There also won't be a risk of becoming a remote relay if you install like this as well.
如果你打算将邮件发送给其他互联网领域,你需要确保机器发送邮件的IP地址已经设置好了反向DNS条目(PTR记录)。多数大型ISP的会拒绝你的邮件,如果你的IP没有指向一个通用主机(例如1.2.3.3.domain.isp.com)PTR记录或1。它应该反向类似mail.yourdomain.com
If you plan on sending mail out to other internet domains, you will need to make sure the IP address of the machine sending mail has a reverse DNS entry (PTR record) set up as well. Most large ISP's will reject your mail if your IP does not have a PTR record or one that points to a generic host (e.g. 1.2.3.3.domain.isp.com). It should reverse to something like mail.yourdomain.com
这篇关于建立一个Ubuntu的/阿帕奇/ PHP机发送电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!