Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Apr 2005
    Location
    PA
    Posts
    117
    Thanks
    0
    Thanked 0 Times in 0 Posts

    simple e-mail script

    here is the script:

    Code:
    <html>
    
    <head>
    
    <title>Send an e-mail!</title>
    
    </head>
    
    <body>
    
    <?php
    
    if($_POST['address']){
    	
    	$address=$_POST['address'];
    	
    	if(!$_POST['subject']){
    	
    		print<<<_HTML_
    <form method="post" action="$_SERVER[PHP_SELF]">
    E-mail: <input type="text" name="address" value="$address">
    <br/>
    Enter a subject: <input type="text" name="subject">
    <br/>
    <input type="submit" value="Submit">
    </form>
    _HTML_;
    	
    	}else{
    	
    		$address=$_POST['address'];
    		$subject=$_POST['subject'];
    		
    		if(!$_POST['body']){
    		
    		print<<<_HTML_
    <form method="post" action="$_SERVER[PHP_SELF]">
    E-mail: <input type="text" name="address" value="$address">
    <br/>
    Subject: <input type="text" name="subject" value="$subject">
    <br/>
    Body: <input type="textarea" name="body" rows="10" columns="10">
    <br/>
    <input type="submit" value="Send">
    </form>
    _HTML_;
    		
    		}else{
    		
    			$body=$_POST['body'];
    			
    			print "email has been sent to:\n$address";
    			
    			mail($addresse,$subject,$body);
    		
    		}
    	
    	}
    
    }else{
    
    	print<<<_HTML_
    <form method="post" action="$_SERVER[PHP_SELF]">
    Enter an e-mail address: <input type="text" name="address">
    <br/><br/>
    <input type="submit" value="Submit">
    </form>
    _HTML_;
    
    }
    
    ?>
    
    </body>
    
    </html>
    I typed in my own e-mail address, and never recieved the e-mail

    how do I get this thing to actually send $body?

    TIA

  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    mail($addresse,$subject,$body);
    Spellchecking your variables will help...

  • #3
    Regular Coder
    Join Date
    Apr 2005
    Location
    PA
    Posts
    117
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ah, many thanks


  •  

    Posting Permissions

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