网站上的联系表和回复电子邮件

网站上的联系表和回复电子邮件

本文介绍了php 网站上的联系表和回复电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用 Rapidweaver 制作的 mediatemple 网格服务器上的网站上有一个 PHP 联系表单.它运行良好,只是它生成到我们的 [email protected] 的电子邮件是作为 [email protected] 发送的.我认为服务器只是使用垃圾/黑洞地址.有什么方法可以调整我的 php 或更好的服务器设置,将邮件作为用户在联系表单本身填写的回复地址发送?

I have a PHP Contact form on a site I am hosing on our mediatemple grid server that was made with Rapidweaver. It works well except that the email it generates to our [email protected] is sent as [email protected]. I think the server is just using the trash/blackhole address. Any way to adjust my php or better yet, the server settings, to send the mail as the reply-to address that the user fills out on the contact form itself?

为什么?好吧,谷歌托管了这个域的电子邮件,我想用他们的预设回复作为自动回复.当然,问题是自动回复发送到 [email protected],而不是他在表单上填写的用户电子邮件地址.

Why? Well Google hosts the email for this domain and I wanted to use their canned responses as an auto-responder. The problem of course, is that the auto-response goes to [email protected] and not the user's email address that he filled in on the form.

感谢您的帮助!

-猎人

推荐答案

您可以在邮件中添加标题

You can add headers to your mail

<?php
$to      = '[email protected]';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: [email protected]' . "
" .
    'Reply-To: [email protected]' . "
" .
    'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);
?>

请参阅 邮件 phpdoc

这篇关于php 网站上的联系表和回复电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-24 01:42