简体   繁体   English

需要使用帮助将表单数据发送到电子邮件地址

[英]Need help sending form data to an e-mail address using

I am using "Easy Forms" to collect data and send it to an e-mail address.我正在使用“Easy Forms”收集数据并将其发送到电子邮件地址。 Easy Forms has an option where you can send a custom coded message in the e-mail address collected. Easy Forms 有一个选项,您可以在该选项中通过收集的电子邮件地址发送自定义编码消息。

I want to use some php/js to send the form data collected.我想使用一些 php/js 来发送收集的表单数据。

This is what the code looks like in the form:代码如下所示:

<div class="form-group required-control">
<label class="control-label" for="text_362504">fullname</label>
<input type="text" id="text_362504" name="text_362504" value="" data- 
alias="" class="form-control" required="">
</div>

Code below that I have inserted in the custom message being sent下面是我在发送的自定义消息中插入的代码

':text_362504'=>$text_362504, ':text_362504'=>$text_362504,

What I am asking for is the command that will take whatever is in the field "fullname" and push it through in the e-mail.我所要求的是一个命令,它将获取“全名”字段中的任何内容并将其推送到电子邮件中。

This is a pretty vague question.这是一个相当模糊的问题。 On future posts, please explain in more detail your problem or what you need help with.在以后的帖子中,请更详细地说明您的问题或需要帮助的内容。

I'm assuming you need an email address from the form as seen here.我假设您需要从这里看到的表单中的电子邮件地址。

<form method="post" action="send.php">    
<div class="form-group required-control">
    <label class="control-label" for="text_362504" >fullname</label>
    <input type="text" id="text_362504" name="name" value="" data- 
    alias="" class="form-control" required="">
    <label class="control-label" for="text_362504_1">email</label>
    <input type="text" id="text_362504_1" name="email" value="" data- 
    alias="" class="form-control" required="">
    <button type="submit" name="button"></button>
    </div>
</form>

In a file in the same directory named "send.php"在名为“send.php”的同一目录中的文件中

<?php
$headers = "From: thisisyou@yourdomain.com" . "\r\n";
$message = "Hello, ".$_POST['email']."!";
$subject = "Test";
mail($_POST['email'],$subject,$message,$headers);
?>

Keep in mind that there are no safety nets ie input scrubbing in this code.请记住,此代码中没有安全网,即输入清理。

Hope this helps.希望这可以帮助。

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

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