Jump to content

Need some form help


kotkoda

Recommended Posts

Hello,

 

I am new to php. Hopefully it is not a difficult thing what I need.

I will have a simple form with first name, last name and email address (and submit, reset) button.

What I need is that the form would send a specific set text together with the fist name and last name to the specified email address. However, I think where the problem lies (or maybe not) is that the message received from the form should look like it came from the Email address of the one filled out the form. (It is a listserv that would receive the message from the form - so it has to be very exact. ) No subject needed all the message has to be in the body...

 

Can anyone help me with this?

Link to comment
https://forums.phpfreaks.com/topic/110805-need-some-form-help/
Share on other sites

I have another problem (different, simple form):

 

Why this does not send back ALL the info from the form? I assume this is the problem:  $name, $message, $email ); but how do I correct it? (I need the form send back name, email, message - that's all in the form itself).

 

v<?php

  $name = $_REQUEST['name'] ;

  $email = $_REQUEST['email'] ;

  $message = $_REQUEST['message'] ;

 

  mail( "[email protected]", "Comment from website",

    $name, $message, $email );

?>

Link to comment
https://forums.phpfreaks.com/topic/110805-need-some-form-help/#findComment-568555
Share on other sites

From what I can make out of you're objective is that you want the user to enter their e-mail address, and you want the e-mail being sent to appear as if it came from the e-mail address they entered? Assuming this is true, you obviously have an input field for them to enter their e-mail address.

 

From that just do something similar to:

 

mail("[email protected]", "Comment from website", $message, "From:" . $email); // $email being the variable which stores the post data.

Link to comment
https://forums.phpfreaks.com/topic/110805-need-some-form-help/#findComment-575316
Share on other sites

A lot of hosting services have started blocking outgoing email where the FROM header is set to an outside domain. Basically they don't want people to use their servers for phishing.

 

Understandable, I suppose if I was in their position I wouldn't want it either.

Link to comment
https://forums.phpfreaks.com/topic/110805-need-some-form-help/#findComment-575343
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.