Home / Internet & Networking / Web design / <>Solved<> Making a Promt Email Me!<>Solved<>
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] - (Bottom) Print
Author Topic: <>Solved<> Making a Promt Email Me!<>Solved<>  (Read 1841 times)
Bannana97
Topic Starter
Intermediate



Posts: 145



Owner of HerbertsWorld Corporation

HerbertsWorld - Free Websites
« 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 » IP logged

Thanks
Bannana97
kpac
Web moderator
Moderator
Hacker



Thanked: 180
Posts: 5,874

Certifications: List
Computer: Specs
Experience: Expert
OS: Windows 7
kpac®

1 1 1
« Reply #1 on: February 06, 2009, 02:55:35 PM »

Are you using JavaScript? JS can't email.

Have a look here.
IP logged

yanng1
Beginner



Posts: 61


« 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( 'SOME-EMAIL-ADDRESS@SOME-DOMAIN.com', '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---------
IP logged
macdad-
Expert



Thanked: 39
Posts: 2,520


LoneWolf's Circuits
« Reply #3 on: February 07, 2009, 09:38:48 AM »

you could try HTML "mailto:" hyperlink.
IP logged

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

Thats why Bill Gates created the Windows NT Family.
Bannana97
Topic Starter
Intermediate



Posts: 145



Owner of HerbertsWorld Corporation

HerbertsWorld - Free Websites
« Reply #4 on: February 12, 2009, 07:16:09 AM »

Yes this would work:


mailto:bailey0912@hotmail.com

BUT I want the forms to be on my website.
IP logged

Thanks
Bannana97
BC_Programmer
Mastermind


Thanked: 697
Posts: 15,881

Computer: Specs
Experience: Beginner
OS: Windows 7


Pinkie Pie is best pony

BC-Programming.com 1 1
« Reply #5 on: February 12, 2009, 07:42:29 AM »

Additionally, Mailto: is a spam magnet.
IP logged

My Blog

BASeBlock 2.3.0 (NOW WITH MACGUFFINS!)
kpac
Web moderator
Moderator
Hacker



Thanked: 180
Posts: 5,874

Certifications: List
Computer: Specs
Experience: Expert
OS: Windows 7
kpac®

1 1 1
« Reply #6 on: February 12, 2009, 10:54:47 AM »

A completely shameless link to my own site. ;D
IP logged

macdad-
Expert



Thanked: 39
Posts: 2,520


LoneWolf's Circuits
« Reply #7 on: February 12, 2009, 12:10:16 PM »

Additionally, Mailto: is a spam magnet.

good point,
IP logged

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

Thats why Bill Gates created the Windows NT Family.
BC_Programmer
Mastermind


Thanked: 697
Posts: 15,881

Computer: Specs
Experience: Beginner
OS: Windows 7


Pinkie Pie is best pony

BC-Programming.com 1 1
« 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
IP logged

My Blog

BASeBlock 2.3.0 (NOW WITH MACGUFFINS!)
Pages: [1] - (Top) Print 
Home / Internet & Networking / Web design / <>Solved<> Making a Promt Email Me!<>Solved<> « previous next »
 


Login with username, password and session length

Old Forum Search | Forum Rules
Copyright © 2010 Computer Hope ® All rights reserved.
Powered by SMF 2.0 RC3 | SMF © 2006–2010, Simple Machines LLC
Page created in 0.099 seconds with 21 queries.