亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

將 php $headers 放在特定聯系表格中以更改電子郵件“發件人”地址的位置

將 php $headers 放在特定聯系表格中以更改電子郵件“發件人”地址的位置

PHP
catspeake 2021-08-28 15:46:35
我正在嘗試$headers = "From: [email protected]\r\n";在 PHP 中使用將聯系表單上的“發件人”電子郵件地址設置為“[email protected]”。它參考了這個答案PHP 郵件函數“來自”地址我對 php 很陌生,所以如果答案很明顯,我很抱歉,但它讓我不知所措。表格的代碼如下,但我似乎無法讓它工作?有誰知道我將如何/在哪里將它與下面的代碼集成在一起。親切的問候,<?php     if($_POST['submit']) {        if(!$_POST['name']) {            $error="<br>- Please enter your name";        }        if(!$_POST['email']) {            $error.="<br>- Please enter your email";        }        if(!$_POST['telephone']) {            $error.="<br>- Please enter your telephone number";        }        if(!$_POST['message']) {            $error.="<br>- Please enter your message";        }        if(!$_POST['checkbox']) {            $error.="<br>- Please confirm you agree to the Privacy Policy";        }        if ($error) {            $result='<div class="alert error">Whoops, there is an error. Please correct the following: '.$error.'</div>';        } else {        mail("[email protected]", "Contact Message", "Name: ".htmlspecialchars($_POST['name'])."            Email: ".htmlspecialchars($_POST['email'])."            Telephone: ".htmlspecialchars($_POST['telephone'])."            Company: ".htmlspecialchars($_POST['company'])."            Budget: ".htmlspecialchars($_POST['budget'])."            Message: ".htmlspecialchars($_POST['message']));            {                $_POST= array();                $result='<div class="alert thankyou" role="alert">THANK YOU! WE\'LL BE IN TOUCH SHORTLY...</div>';            }        }    }?>
查看完整描述

1 回答

  • 1 回答
  • 0 關注
  • 152 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號