本文介绍了将发件人电子邮件地址以php形式更改为收件人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试创建一个简单的php电子邮件表单,将提交的内容发送到指定的地址,但是我要修复的问题是电子邮件地址发送 - 目前,它是从myusername @ myhostingservice.com,但我希望能够将其改成一个简单的[email protected]或其他的东西。
I'm trying to create a simple php email form that sends the submitted contents to a specified address, but the problem I'm trying to fix is the address the email is being sent from — currently, it sends from [email protected], but I want to be able to change that to a simple [email protected] or something else.
<?php
$message = $_POST['message'];
$formcontent="$message";
$recipient = "[email protected]";
$subject = "question";
mail($recipient, $subject, $formcontent, $header, '[email protected]') or die("Error!");
header("Location: webpage_user_is_redirected_to.html");
?>
推荐答案
可以使用邮件功能的第5个参数:
You can use the 5th parameter of the mail function:
mail($recipient, $subject, $formcontent, $header, '[email protected]');
从:
这篇关于将发件人电子邮件地址以php形式更改为收件人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!