Page 1 of 3 123 LastLast
Results 1 to 10 of 26

Thread: php email? rep+

  1. #1
    Join Date
    Jan 2010
    Posts
    3,641
    Tokens
    138

    Latest Awards:

    Default php email? rep+

    I have 1 field for the user to fill it then when they click Submit it sends that 1 piece of information to my email.

    How can I do this?

  2. #2
    Join Date
    Jan 2010
    Location
    United Kingdom
    Posts
    846
    Tokens
    1,766
    Habbo
    triston220

    Latest Awards:

    Default

    PHP Code:
      <?php
    $to 
    "[email protected]"// The email address to send the message to.
    $body ="Message here " $_POST['textboxname']; //The body of our message. Separate lines with "\n".
    $body =wordwrap($body,70); // 70 Chars per line
    $subject "Hello"//The subject of our message.
    mail($to$subject$body); //Send the message
    ?>
    Last edited by triston220; 12-11-2011 at 08:27 PM.


    Quote Originally Posted by Jaaaack! View Post
    See, however much I want this, my girlfriend uses my PC too much, and I would be killed.





  3. #3
    Join Date
    Jan 2010
    Posts
    3,641
    Tokens
    138

    Latest Awards:

    Default

    Quote Originally Posted by triston220 View Post
    PHP Code:
    <?php
    $to 
    "example[@]@expample.com"[/@]; // The email address to send the message to.
    $body ="Message here " $_POST['textboxname']; //The body of our message. Separate lines with "\n".
    $body =wordwrap($body,70); // 70 Chars per line
    $subject "Hello"//The subject of our message.
    mail($to$subject$body); //Send the message
    ?>
    I need to email the information they put in the textbox to me.
    this is my html form thingy:
    HTML Code:
    <html>
    	<br /><br /><br />			<center>			<form action="send.php" method="POST">				name: <input type="text" name="name" /><br />				<i>(Case sensitive)</i><br />				<input type="submit" value="Submit" />			</form>		</center>		</html>
    and i need to sent the information given in that name field to my email.
    Last edited by Thomas; 12-11-2011 at 09:09 PM.

  4. #4
    Join Date
    Jan 2010
    Location
    United Kingdom
    Posts
    846
    Tokens
    1,766
    Habbo
    triston220

    Latest Awards:

    Default

    Quote Originally Posted by Thomas View Post
    I need to email the information they put in the textbox to me.
    this is my html form thingy:
    HTML Code:
    <html>
    <br /><br /><br /><center><form action="send.php" method="POST">name: <input type="text" name="name" /><br /><i>(Case sensitive)</i><br /><input type="submit" value="Submit" /></form></center></html>
    and i need to sent the information given in that name field to my email.
    What's the name of the textbox.


    Quote Originally Posted by Jaaaack! View Post
    See, however much I want this, my girlfriend uses my PC too much, and I would be killed.





  5. #5
    Join Date
    Jan 2010
    Posts
    3,641
    Tokens
    138

    Latest Awards:

    Default

    Quote Originally Posted by triston220 View Post
    What's the name of the textbox.
    It does say in that html code i posted...? or i am being stupid?

    <html> <br /><br /><br /> <center> <form action="send.php" method="POST"> name: <input type="text" name="name" /><br /> <i>(Case sensitive)</i><br /> <input type="submit" value="Submit" /> </form> </center> </html>

  6. #6
    Join Date
    Jan 2010
    Location
    United Kingdom
    Posts
    846
    Tokens
    1,766
    Habbo
    triston220

    Latest Awards:

    Default

    PHP Code:
     <?php
    $to
    ="[email protected]";//Theemailaddresstosendthemessageto.
    $body=$_POST['name'];//Thebodyofourmessage.Separatelineswith"\n".
    $body=wordwrap($body,70);//70Charsperline
    $subject="Hello";//Thesubjectofourmessage.
    mail($to,$subject,$body);//Sendthemessage
    ?>


    Quote Originally Posted by Jaaaack! View Post
    See, however much I want this, my girlfriend uses my PC too much, and I would be killed.





  7. #7
    Join Date
    Jan 2010
    Posts
    3,641
    Tokens
    138

    Latest Awards:

    Default

    Quote Originally Posted by triston220 View Post
    PHP Code:
    <?php
    $to
    ="example[@]@expample.com"[/@];//Theemailaddresstosendthemessageto.
    $body=$_POST['name'];//Thebodyofourmessage.Separatelineswith"\n".
    $body=wordwrap($body,70);//70Charsperline
    $subject="Hello";//Thesubjectofourmessage.
    mail($to,$subject,$body);//Sendthemessage
    ?>
    It sends (it think) but i do not get any email

    try it: www.supersurvival.net/join
    Last edited by Thomas; 12-11-2011 at 10:30 PM.

  8. #8
    Join Date
    Jan 2010
    Posts
    3,641
    Tokens
    138

    Latest Awards:

    Default

    still not working, anyone?

  9. #9
    Join Date
    Jan 2010
    Posts
    3,641
    Tokens
    138

    Latest Awards:

    Default

    HTML Code:
    <html>
    <br /><br /><br />
        <center>        <form method="POST">            Minecraft name: <input type="text" name="name" /><br />            <i>(Case sensitive)</i><br />            <input type="submit" value="Submit" />        </form>    </center>
    <?php mail('t.*******[@]@*****.co.uk', 'SuperSurvival', $_POST["name"][/@];); ?>
    </html>
    Excuse my how bad i am at html and php

  10. #10
    Join Date
    Oct 2006
    Posts
    9,905
    Tokens
    26,858
    Habbo
    Zak

    Latest Awards:

    Default

    Make a separate page for your php code (e.g. mail.php).

    Then link to it with your form, example
    PHP Code:
    <form action='mail.php' method='POST'

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •