简体   繁体   English

用户在通讯表单中提交 email 地址后,如何自动发送 email?

[英]How do i automatically send an email after user submit their email address in the newsletter form?

I want to automatically send an email that says "thank you for signing up for our newsletter form. If you have any questions please email kundeservice@.....no我想自动发送一个 email,上面写着“感谢您注册我们的时事通讯表格。如果您有任何问题,请 email kundeservice@.....no

I have tried multiple different codes that I tried to change but nothing has worked.我尝试了多个不同的代码,我试图更改但没有任何效果。 I need to use the $_GET['epost'] so I send it correctly to the email.我需要使用the $_GET['epost']所以我将它正确发送到 email。

I am not sure if I need to install something on the terminal.我不确定是否需要在终端上安装一些东西。 Currently using ubuntu 18.04目前使用ubuntu 18.04

HTML: HTML:

<form name="form" class="forms" action="/backup/formsend.php" id="formn" method="post" >
    <div class="email">
        <input type="text" name="epost" id="epost" placeholder="E-Post" required>
    </div>

    <div class="submitknapp">
        <input class="knapp" type="submit" name="submit" value="Send"></input>
    </div>
</form>

you need to save this form inputs into your database, then you will send him a welcome email, so you will use phpmailer library if you write pure PHP it's so simple https://github.com/PHPMailer/PHPMailer您需要将此表单输入保存到您的数据库中,然后您将向他发送欢迎 email,因此如果您编写纯 PHP,您将使用 phpmailer 库,它是如此简单Z5E056C500A1C4B6A7110Bcom/D8MailerPHP5://githubBADEPHP7.

<?php
    $email = $_POST['epost'];
    $email_subject = "News letter";
    $email_content = "thank you for signing up for our newsletter form. If you have any questions please email kundeservice@.....no";
    mail($email,$email_subject,$email_content);
?>

mail() function is used to send email to mentioned email address. mail() function 用于将 email 发送到提到的 email 地址。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM