Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => Mail

mail not working

the mail() function

Moderators: macek, egami, gesf

mail not working

Postby xlordt » Tue Feb 18, 2003 1:18 am

sup... nice site.. anyways.. i am tring to create a memo script.. but the mail part of my script is not working...

Code: Select all
if ($submit){
  $A = "SELECT email FROM gl_users WHERE $username=email";
 
  $msg .= "You have recived a memo in  from " . $_POST['username'];
  if(mail($A['email'], "memo", "$msg", "FROM: xlordt.net")){
     echo "";
}
 
  if($_POST['username'] == ""){
  echo '<CENTER> Please Enter a user name';
  } else if($_POST['memo'] == ""){
   echo '<CENTER> Please Enter a message to send';
  }
 
 $sender = $_USER['username'];
 $date = date("D dS M,Y h:i a");
 $sql = "INSERT INTO gl_memo(sender, username, memo, date) VALUES ('$sender', '$username',
         '$_POST[memo]', '$date')";
 $result = mysql_query($sql) or die(mysql_error());   
 echo "<br><br><br>Memo Sent to " . $username;
 
 // Redirect back to home page
 echo "<br>You are now being redirected";
 echo '<meta http-equiv="refresh" content="2;url=http://www.xlordt.net">';
 
  }else{
  // Select users from db
  $result = "SELECT * FROM gl_users";
  $sql = mysql_query($result) or die(mysql_error());
  WHILE ($row = mysql_fetch_array($sql)){
  $username = $row['username'];
  $option_block .= "<option name=\"username\"> ".  $row['username'] . "</option>";
 
  }
  // Show Form
  echo '<BR><BR><FORM METHOD="POST" ACTION=' . $PHP_SELF . '>
             <TABLE WIDTH=55% align=center><TR><TD><br>
          From: <b>' . $_USER[username] . '</b><br>
             Select user: <br>
            <SELECT NAME="username"><br> ' .
            $option_block . '<br>
          </SELECT><BR><br>
          Messege: <br>
          <TEXTAREA ROWS=8 COLS=65 NAME="memo"></TEXTAREA><br>
          <INPUT TYPE="submit" NAME="submit" ALT="submit" value="submit memo">
          </FORM></TD></TR></TABLE>
';
 
}   
echo COM_sitefooter(true);   
?>


anyhelp will do .. thanx
User avatar
xlordt
New php-forum User
New php-forum User
 
Posts: 34
Joined: Thu Dec 12, 2002 9:00 pm
Location: NJ

Return to PHP coding => Mail

Who is online

Users browsing this forum: No registered users and 5 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.