Jump to content
xisto Community
Sign in to follow this  
MaRiOnI

Email Code

Recommended Posts

CODE <? if($submit) //If submit is pressed { mail("youremailaddress@whatever.com", "$subject", "$email", "$comments"); } else {?> <form method='post' action='<? echo $PHP_SELF; ?>'> E-Mail: <INPUT TYPE='TEXT' NAME='email' size=60> Subject: <INPUT TYPE='TEXT' NAME='subject' size=60> Comments: <TEXTAREA NAME='comments' ROWS=10 COLS=30></TEXTAREA> <input type='submit' name='submit' value='submit'> </form> <? }?>

Share this post


Link to post
Share on other sites

I guess u forgot to take the variables from your POST-action...Put something like this before the mail-function.$email = $_POST["email"];$subject = $_POST["subject"];$comments = $_POST["comments]:$date = date("Y-m-d H:i");$body = "Email: " . $email . "Comments: " . $comments . "Date: " . $date . "This was send automatticaly."$mail = mail("yourmail@domain.com",$subject,$body,"From:$email");

Share this post


Link to post
Share on other sites

I guess u forgot to take the variables from your POST-action...

Put something like this before the mail-function.

 

$email = $_POST["email"];

$subject = $_POST["subject"];

$comments = $_POST["comments]:

$date = date("Y-m-d H:i");

$body = "

 

Email: " . $email . "

Comments: " . $comments . "

 

Date: " . $date . "

 

This was send automatticaly."

 

$mail = mail("yourmail@domain.com",$subject,$body,"From:$email");

41490[/snapback]


it's not really needed, only if the register_blobals in php.ini is turned off (its not Xisto case). Every hosts turns it on.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.