配置邮件服务器以使用 PHP [英] Configure mail server to work with PHP

查看:34
本文介绍了配置邮件服务器以使用 PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我当前的项目是一个接收用户输入的表单.收到该数据后,我必须向几个电子邮件地址发送警告/报告,包括插入数据的用户.Apache、MySQL、PHP 几乎所有东西都已启动并运行.

My current project is a form that receives input from a user. After I receive that data, I must send a warning/report to a few email addresses, including the user who inserted the data. Almost everything is up and running, Apache, MySQL, PHP.

现在我从来没有安装过邮件服务器来使用 PHP,所以我有点迷茫.

Now I never installed a mail server, to work with PHP so I'm kinda lost.

我的雇主在他的服务器上安装了 MS Exchange 2007.我应该使用它,我将如何开始配置 php 以使用它?我需要从 Exchange 2007 获得什么(参数)?

My employer has MS Exchange 2007 on his server installed. Should I use it, and how would I start to configure php to work with it? What do I need from the Exchange 2007 (parameters)?

如果没有,您是否建议为此目的在具有 Apache+MySQL+PHP 的同一台机器上安装一个新的邮件服务器?

If not, would you recommend installing a new mail server for just this purpose on the same machine that has Apache+MySQL+PHP?

我更倾向于使用已经存在的 Exchange 服务器,但我在一些在线文章中看到它不是最容易配置的东西.

I am more inclined to use the already present Exchange server, but I read at some online articles that it's not the easiest thing to configure.

更新:

<?php
include("Mail/Mail.php");
/* mail setup recipients, subject etc */
$recipients = "mail@mail.com";
$headers["From"] = "mail@mail.com";
$headers["To"] = "someone@mail.com";
$headers["Subject"] = "User feedback";
$mailmsg = "Hello, This is a test.";
/* SMTP server name, port, user/passwd */
$smtpinfo["host"] = "mail.name.com";
$smtpinfo["port"] = "25";
$smtpinfo["auth"] = true;
$smtpinfo["username"] = "username";
$smtpinfo["password"] = "pass";
/* Create the mail object using the Mail::factory method */
$mail_object =& Mail::factory("smtp", $smtpinfo);
/* Ok send mail */
$mail_object->send($recipients, $headers, $mailmsg);
?>

使用上面的这个例子,我无法通过 Exchange 2007 发送邮件.

Using this example above I can't send mail through Exchange 2007.

页面上没有错误输出,所以我有点迷茫.不知道怎么回事.

I get no errors output on the page, so I'm kinda lost. Don't know what is wrong.

更新:谁能推荐一个好的邮件服务器?

UPDATE: Can anyone recommend a good mail server?

推荐答案

好的.得到它的工作.呼.

Ok. Got it to work. Phew.

我在阅读了很多之后找到了原因.这是关于 smtp 交换服务器的中继问题.

I found out the reason, after reading alot. It was regarding a relay problem with the smtp exchange server.

但如果不是你们这些人,我永远不会到达那里.xD

But I would have never got there if it wasn't for you people. xD

谢谢大家.=)

这篇关于配置邮件服务器以使用 PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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