设置 Ubuntu/Apache/PHP 机器来发送电子邮件 [英] Setting up a Ubuntu/Apache/PHP machine to send email

查看:28
本文介绍了设置 Ubuntu/Apache/PHP 机器来发送电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在胡志明市的一家小型公司工作,该公司唯一的服务器只是一台旧的小型计算机.现在仅仅几个月后,我们正在迅速扩张,对新用户的要求之一是要求他们验证他们的电子邮件地址.

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 重新格式化整个硬盘并在其上安装 Natty Narwhal,然后安装 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.

对于我首先需要设置的内容的任何想法将不胜感激;我不是在寻找一步一步的方法,只是为我指明正确方向的一些提示.

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 Van

推荐答案

sudo apt-get install sendmail 将安装本地侦听的 sendmail 副本.如果你安装了它,那么 php 就可以使用内置的 mail() 函数.如果您也这样安装,也不会有成为远程中继的风险.

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.

如果您打算将邮件发送到其他 Internet 域,则需要确保发送邮件的机器的 IP 地址也设置了反向 DNS 条目(PTR 记录).如果您的 IP 没有 PTR 记录或指向通用主机的记录(例如 1.2.3.3.domain.isp.com),大多数大型 ISP 将拒绝您的邮件.它应该反转为类似 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/Apache/PHP 机器来发送电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆