Populate sender email address in from...

User 476372 Photo


Registered User
194 posts

Hi,
Is there a way to have the senders email address be the one that is in the 'from' spot when I form is submitted? I have a client that is using gmail and their email forms are grouping together and she doesn't want them to. I suggested turning off the 'conversation view' in gmail but she doesn't want to disable it completely. Or, maybe there is another solution I haven't thought of?

Thanks!
SPOON FROG graphics - Affordable Web Site Design & Ecommerce Design
www.spoonfroggraphics.com
User 187934 Photo


Senior Advisor
20,193 posts

Hi Spoonfrog,
I would use the custom redirect option and send the email in the form from a custom script where you can manipulate the email from value.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 476372 Photo


Registered User
194 posts

Hi,
Thank you! Can you explain a bit more because I don't know how to do that.

Thanks!
SPOON FROG graphics - Affordable Web Site Design & Ecommerce Design
www.spoonfroggraphics.com
User 187934 Photo


Senior Advisor
20,193 posts

In the Form Builder go to the Setting, then Comfirm Page. There select Redirect to another URL.
Enter the url for your custom php script.
Here's a quick dirty example to get you started. Save this as a php page and upload it to your host. Enter it's location in your Form Builder option Redirect to another URL.
<?php
session_start(); ?>
<html lang="en">
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<?php
$post = $_SESSION['post']; // This is getting the post array
$email = $post['email']; // *******This is getting my email input name from the array called "email"
// Add more as needed for each input on your form. Adjust to your input name.

if(isset($email)) {echo'You made it to my page.<br><br> Here is what you chose on my form.<br><br>
The email you entered was '.$email.'<br><br>

Refresh your browser to see the Session unset.<br><br>
Here\'s the session array. The one that holds the form variables is named post.';
echo '<pre>' . print_r($_SESSION, TRUE) . '</pre>';


//Email information
$to = "myname@mydomain.com"; // *******Edit to where you want the email to go. Can be multiple.
$email = $email;
$subject = 'Your Form';
$message = 'This message has a custom from email of '.$email;

//Send email
mail($to, $subject, $message, "From:" . $email);

//Email response
echo "Thank you for contacting us!";




}
else{
echo 'You should check out my <a href="email-from/index.html">email form.</a>'; //******* Edit to your form location
}
unset($_SESSION['post']); // This unsets the $_SESSION['post'] array
// Here's how to unset one variable.
//$key=array_search($post['email'],$_SESSION['post']);
// if($key!==false) unset($_SESSION['post'][$key]);
?>
</body>
</html>
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 476372 Photo


Registered User
194 posts

Hi,
THANK YOU! I set everything up and it redirects to the php script but all it does is shows that to the person who filled out the form online. As for the email with the form results, it looks exactly the same. Here is what it redirects to (see attachment). I know I am missing something but I don't know what. I am horrible with php. LOL!
Attachments:
SPOON FROG graphics - Affordable Web Site Design & Ecommerce Design
www.spoonfroggraphics.com
User 187934 Photo


Senior Advisor
20,193 posts

That’s working. Great job. Did you get the emails?
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 476372 Photo


Registered User
194 posts

Hi,
Yes, I did get the emails, but the from email address isn't being pulled from the form. Does that make sense?
SPOON FROG graphics - Affordable Web Site Design & Ecommerce Design
www.spoonfroggraphics.com
User 187934 Photo


Senior Advisor
20,193 posts

The email you entered in your form is in the screen shot you posted. Maybe I misunderstood what you wanted.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 476372 Photo


Registered User
194 posts

Hi,
Let me see if I can explain it better. I need each one of these to come through 'unique'. Because they the subject is the same and the 'from' email address is the same they are grouping together in my clients gmail. She doesn't want to turn off the 'conversation' mode in gmail but doesn't want these emails to be grouped together. I figured if I could get the 'from' email address to change, as they came in, that would make them unique and not group together. If there is another way, I am TOTALLY open to try that.
SPOON FROG graphics - Affordable Web Site Design & Ecommerce Design
www.spoonfroggraphics.com
User 187934 Photo


Senior Advisor
20,193 posts

Do you want the From: email to be the one people fill out in the form?
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.