简体   繁体   中英

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 has an option where you can send a custom coded message in the e-mail address collected.

I want to use some php/js to send the form data collected.

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,

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"

<?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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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