【问题标题】:modifying php email form into a smtp email form将php电子邮件表单修改为smtp电子邮件表单
【发布时间】:2014-04-14 14:44:18
【问题描述】:

您好,我有一个自包含的电子邮件表单,因此它不需要任何其他脚本有些可以帮助我

我的电子邮件表格是这样的:

<html> 
<head>
<!--[if !IE]><!-->
<link rel="stylesheet" type="text/css" href="Register.css">
<!--<![endif]-->
</head>
<body style="background-color:#303030">
<?php
// display form if user has not clicked submit
if (!isset($_POST["submit"]))
    {
?>
    <div id="login">
    <form method="post" action="<?php echo $_SERVER["PHP_SELF"];?>">
       <input type="hidden" name="subject" value="can you create me an account"><br/>
       Message: <textarea rows="10" cols="40" name="message"></textarea><br/>
       first <input type="text" name="first_name" ><br/>
       last <input type="text" name="last_name" ><br/>
       company <input type="text" name="company" ><br/>
       email <input type="text" name="email" ><br/>
       Telephone number <input type="text" name="telnr" ><br/>
       Description <input type="text" name="Description" ><br/>
       <input type="submit" name="submit" value="Submit Feedback">
    </form>
    </div>  

<?php 
    }
    else
  // the user has submitted the form
    {
  // Check if the "subject" input field is filled out
    var_dump($_POST);
if (isset($_POST["subject"]))
    {
        $subject = $_POST["subject"];
        $message = $_POST["message"];
        $first = $_POST["first_name"];
        $last = $_POST["last_name"];
        $company = $_POST["company"];
        $email = $_POST["email"];
        $telnr = $_POST["telnr"];
        $description = $_POST["Description"];
        $therest = "First name= $first" . "\r\n" . "Last name= $last" . "\r\n" . "Company= $company" . "\r\n" . "Email= $email" . "\r\n" . "Telnr= $telnr" . "\r\n" . "Description= $description";          
    }
        echo "$therest <br>";
        $message = wordwrap($message, 700);
        $first = wordwrap($first, 70);
        $last = wordwrap($last, 70);
        mail("receiver@whatever.co.uk",$subject,$name,$therest,"subject: $subject\n");
        echo "Thank you for sending us feedback";
    }
?>
</body>
</html>

【问题讨论】:

  • 服务器上是否安装了 PEAR MAIL 包? (不需要,但我一直使用它)
  • @Daan 目前没有它没有安装任何想法如何将此表单转换为 smtp 授权表单或任何想法我可以
  • 我打算使用 class.phpmailer.php 和 class.smtp.php @Daan
  • 从来没有用过那些对不起。只需查看文档。
  • @Daan 你会怎么做??

标签: php html forms email smtp


【解决方案1】:

对此的回答是否定的,此表单无法更改为SMTP 电子邮件表单我需要做的是创建一个使用 PHPMailer 的表单,然后我添加了我需要的输入框,这增加了更多的开发该网站,但它实际上正在我试图访问的服务器上运行

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-06-07
    • 2011-06-26
    • 2013-11-04
    • 1970-01-01
    • 2011-10-07
    • 1970-01-01
    • 2012-01-12
    相关资源
    最近更新 更多