配置邮件服务器支持PHP [英] Configure mail server to work with PHP

查看:99
本文介绍了配置邮件服务器支持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)?

如果没有,你会建议安装一个新的邮件服务器这个目的有阿帕奇+ 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?

我更倾向于使用已经present 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天全站免登陆