PHP 中的基本联系表

发布于 2024-08-28 08:51:06 字数 630 浏览 4 评论 0原文

我正在为我的教会网站制作联系表。

教堂已经注册了一个电子邮件(它是 POP3),托管公司表示他们的邮件服务器是 mymail.brinkster.com 。

有了所有这些信息,如何使用 mail() 发送表单?服务器不会显示 PHP 错误。当前的代码如下所示:

    $headers = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    $headers .= 'From: *ChurchsEmail*' . "\r\n";

if(mail("*MyEmailHere*", "Setting Up PHP Email", "This would be the body of the email.", $headers))
{
        echo "The email was successfully sent.";
} else {
        echo "The email was NOT sent.";
}

我得到的只是“电子邮件未发送”。

那么有人有设置这样的电子邮件表单的经验吗?我感谢任何可以帮助我的人以及任何有效的方法,请告诉我!

I'm working on a contact form for my church website.

The church has an email already registered (it's POP3) and the hosting company says their mail server is mymail.brinkster.com .

With all that information, how can you send the form using mail()? The server won't show PHP errors. The current code looks like this:

    $headers = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    $headers .= 'From: *ChurchsEmail*' . "\r\n";

if(mail("*MyEmailHere*", "Setting Up PHP Email", "This would be the body of the email.", $headers))
{
        echo "The email was successfully sent.";
} else {
        echo "The email was NOT sent.";
}

All I get back is "The email was NOT sent."

So does anyone have any experience setting up an email form like this? My thanks to anyone who can help me out and any efficient ways of doing this, let me know!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

萧瑟寒风 2024-09-04 08:51:06

要直接使用 PHP mail() 函数,您的服务器必须正确设置邮件服务器。

如果您想通过外部帐户/服务器通过 SMTP 发送邮件,我建议您使用此处找到的库: http:// phpmailer.worxware.com/
您还可以使用他们的 PHPMailer-FE,它甚至可以将您的联系表格转换为电子邮件。

To use the PHP mail() function directly, your server has to be properly set up with a mail server.

If you want to send mail over SMTP through an external account/server I suggest you use a library found here: http://phpmailer.worxware.com/
You could also use their PHPMailer-FE which will even convert your contact form into an email for you.

审判长 2024-09-04 08:51:06

您可能需要配置它。
cli/apache 用户需要有权访问 sendmail。

You probably need to configure it.
The cli/apache user need to have access to sendmail.

遮云壑 2024-09-04 08:51:06

我正在搜索他们的支持数据库并找到如何使电子邮件正常工作的方法。它告诉我包含一个名为“class.phpmailer.php”的服务器文件

针对 Brinkster 用户的文章。

感谢大家的帮助!

I was searching through their support database and found out how to get email working. It told me to include a server-file called "class.phpmailer.php"

Article for Brinkster users.

Thanks everyone for the help!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文