> Can someone please tell me what did i do wrong in the following php
> mail function?
> 
> I created the following php file using the mail() function but i keep
> getting the 'failed to connect.unable to send your mail.' message. Can
> anyone please tell me what did i do wrong? thx
> 
> <? function show_form($email="",
>                 $message="",$subject="") {  ?>
> 
> <h2>Send Me an E-mail</h2> 
> 
> <form action="email.php" method="post">
> 
> Your E-mail address:<br>
> <input type=text name=email size=30 
>         value="<?echo $email?>"><br>
> 
> The Subject:<br>
> <input type=text name=subject size=30 
>         value="<?echo $subject?>"><br> 
> 
> Your Message:<br>
> <textarea rows=10 cols=50 name=message>
> <?echo $message?>
> </textarea><br>
> <input type=submit value="Send E-mail">
> </form>
> 
> <? }  
> 
> 
> if (!isset($email) or !isset($message)) {
>      show_form();
> }
> else {
>   if (empty($email) or empty($message)) {
>       echo "<H1>There is a Problem:</H1>";
>       if (empty($email)) {
>          echo "I need your email address in 
>               order to write back.  Please fill 
>               it in below.  Thank you.";
>       }
>       if (empty($message)) {
>              echo "You did not write anything.  
>                Please write something.  Thank You.";  
>       }
>       show_form($email,$message,$subject);
>   }
>   else {
>      if (empty($subject)) { 
>              $subject="your email";  
>      }
> 
> 
>      $sent = mail( "[EMAIL PROTECTED]", 
>               $subject,$message, "From: $email" );
> 
>      if ($sent) {
>         echo "<H1>Your Message Has Been Sent.</H1>";  
>         echo "Thank you, <b>$email</b>.  <p>I'll
>                   will read your email regarding '
>                   <b>$subject</b> and reply soon.";  
>      }
>      else {
>         echo "<H1>There is a Problem:</H1>
>               <p>The server was unable to send your
>                    mail.";
>         }
>   }
> }
> ?>
> 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to