Skip to content Skip to sidebar Skip to footer

How To Grab Input Email Address And Use It In Formtoemail.php Script?

I am using FormToEmail.php free script to send some form data from a page where user enters their email and recipient's email and obviously some text as message. In FormToEmail.php

Solution 1:

There is a text in comments of that script:

Step2:

Enteryouremailaddress.

After comments block there is a line:

$my_email = "delete these words and put the email address only in here between the quotes";

Suppose you have harcoded address instead of "delete these ....". You should simply replace that line with:

$my_email = !empty($_REQUEST['recepient_email_field_name']) ? $_REQUEST['recepient_email_field_name'] : "default email address";

Where recepient_email_field_name is name of a field on a form where user should enter his email and default email address should be replaced with that email you have there currently.

Solution 2:

Instead of this code:

$my_email = "delete these words and put the email address only in here between the quotes";

Add this:

if (!empty($_POST['email'])) {
  $my_email = trim($_POST['email']);
} else {
  $my_email = "defaultemailaddress@domain.com";
}

Replace the default with your own or any other.

Post a Comment for "How To Grab Input Email Address And Use It In Formtoemail.php Script?"