Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: <>Solved<> Making a Promt Email Me!<>Solved<>  (Read 7554 times)

0 Members and 1 Guest are viewing this topic.

Bannana97

    Topic Starter


    Intermediate
  • Owner of HerbertsWorld Corporation
    <>Solved<> Making a Promt Email Me!<>Solved<>
    « on: February 06, 2009, 02:22:43 PM »
    I have my promt in a button, using an onclick event.

    How would I make it email me what the user types in?
    « Last Edit: March 08, 2009, 06:55:12 PM by Bannana97 »
    Thanks
    Bannana97

    kpac

    • Web moderator
    • Moderator


    • Hacker

    • kpac®
    • Thanked: 184
      • Yes
      • Yes
      • Yes
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 7
    Re: Help! Making a Promt Email Me!
    « Reply #1 on: February 06, 2009, 02:55:35 PM »
    Are you using JavaScript? JS can't email.

    Have a look here.

    yanng1



      Beginner

      Re: Help! Making a Promt Email Me!
      « Reply #2 on: February 06, 2009, 10:24:14 PM »

      PHP is a fun, safe reliable tool for this job.  Most commercial servers run it these days. 
      this form uses the POST method (a special HTTP request which hides the users input)


      code for page with form to take user input
      **********************************

      <form method="post" action="mailSender.php">
            
         Your Name: <input type="text" size="30" maxlength="40" name="name"> </input><br > <br >
            
         Your Email: <input type="text" size="30" maxlength="60" name="addy">  </input>
       

               
         <textarea style="height:100px; width:400px;" name=msg>
                                    
         </textarea   >
                                    
         <br >
         <input type="submit" value="Send"> </input>
      </form >


      ---- end page




      code for page which recieves user input
      (the code in the first page needs to know this pages name. In page 1 it assumes this page is called mailSender.php)
      ******************************************************************************************************************

      <?php

              // POST gets data from referencing page
         $body_of_email=$_POST['msg'];
         $ad= $_POST['addy'];

          $len = strlen($ad);
          $pos = strpos($ad, '@');       

                      //check for common typos
            if($ad==null || $pos ==false || $len<6)
            {
               echo "You forgot, or entered the wrong email address  Please click back and enter address.";
               
            }

             else{
            
               if (mail( '[email protected]', 'An email from some website', $body_of_email, $ad))
               {
                  echo "<center>";
                  echo("
       
       
       <b/> <font color=white size=4> Message successfully sent!</b/>");
                  echo "
       
       
       <a href=\"index.php\"> Continue </a/>";
                }
               else
               {
                  echo(" Message delivery failed...");
                }
            }

            
      ?>

      ----end page---------

      macdad-



        Expert

        Thanked: 40
        Re: Help! Making a Promt Email Me!
        « Reply #3 on: February 07, 2009, 09:38:48 AM »
        you could try HTML "mailto:" hyperlink.
        If you dont know DOS, you dont know Windows...

        Thats why Bill Gates created the Windows NT Family.

        Bannana97

          Topic Starter


          Intermediate
        • Owner of HerbertsWorld Corporation
          Re: Help! Making a Promt Email Me!
          « Reply #4 on: February 12, 2009, 07:16:09 AM »
          Yes this would work:


          mailto:[email protected]

          BUT I want the forms to be on my website.
          Thanks
          Bannana97

          BC_Programmer


            Mastermind
          • Typing is no substitute for thinking.
          • Thanked: 1140
            • Yes
            • Yes
            • BC-Programming.com
          • Certifications: List
          • Computer: Specs
          • Experience: Beginner
          • OS: Windows 11
          Re: Help! Making a Promt Email Me!
          « Reply #5 on: February 12, 2009, 07:42:29 AM »
          Additionally, Mailto: is a spam magnet.
          I was trying to dereference Null Pointers before it was cool.

          kpac

          • Web moderator
          • Moderator


          • Hacker

          • kpac®
          • Thanked: 184
            • Yes
            • Yes
            • Yes
          • Certifications: List
          • Computer: Specs
          • Experience: Expert
          • OS: Windows 7
          Re: Help! Making a Promt Email Me!
          « Reply #6 on: February 12, 2009, 10:54:47 AM »
          A completely shameless link to my own site. ;D

          macdad-



            Expert

            Thanked: 40
            Re: Help! Making a Promt Email Me!
            « Reply #7 on: February 12, 2009, 12:10:16 PM »
            Additionally, Mailto: is a spam magnet.

            good point,
            If you dont know DOS, you dont know Windows...

            Thats why Bill Gates created the Windows NT Family.

            BC_Programmer


              Mastermind
            • Typing is no substitute for thinking.
            • Thanked: 1140
              • Yes
              • Yes
              • BC-Programming.com
            • Certifications: List
            • Computer: Specs
            • Experience: Beginner
            • OS: Windows 11
            Re: Help! Making a Promt Email Me!
            « Reply #8 on: February 12, 2009, 12:13:09 PM »
            Additionally, Mailto: is a spam magnet.

            good point,

            yeah, learned about that the hard way myself.

            Try over 8000 e-mails under my old E-mail account.  :o
            I was trying to dereference Null Pointers before it was cool.