mail not working

the mail() function

Moderators: egami, macek, gesf

Post Reply
User avatar
New php-forum User
New php-forum User
Posts: 34
Joined: Thu Dec 12, 2002 9:00 pm
Location: NJ

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:")){
     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=">';
  // 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
             <TABLE WIDTH=55% align=center><TR><TD><br>
          From: <b>' . $_USER[username] . '</b><br>
             Select user: <br>
            <SELECT NAME="username"><br> ' .
            $option_block . '<br>
          Messege: <br>
          <TEXTAREA ROWS=8 COLS=65 NAME="memo"></TEXTAREA><br>
          <INPUT TYPE="submit" NAME="submit" ALT="submit" value="submit memo">
echo COM_sitefooter(true);   

anyhelp will do .. thanx
Computer/Programm rox.. (php, c/c++ will take over soon muhahah

Post Reply