SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict einSTein's Avatar
    Join Date
    Aug 2006
    Posts
    276
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    php mail function error

    the code below must send the content of mail.php as a message content
    * the sent message didn't took the content of mail.php it sends "1"
    PHP Code:
    <?php
    include 'connect.php';
    $result22 mysql_query("SELECT * FROM maill");
    while(
    $row mysql_fetch_array($result22))
            { 
            
    $to $row ['add'];
            
    //echo $to;
            
    $subject 'PHP Course only for 80 LE';
            
    $message = include 'mail.php'; -----> error line
            
    /*$headers = 'From: admin@computilities.info' . "\r\n" .
                'Reply-To: admin@computilities.info' . "\r\n" .
                'X-Mailer: HTML/' . phpversion();*/
            
    $headers "MIME-Version: 1.0" "\r\n";
            
    $headers .= "Content-type:text/html;charset=iso-8859-1" "\r\n";
            
    // More headers
            
    $headers .= 'From: <admin@computilities.info>' "\r\n";
            
    $headers .= 'Reply-To: <admin@computilities.info>' "\r\n";
            
    mail($to$subject$message$headers);
            if(!
    mail)
                {
                echo 
    "mail sending error";
                }
            else
                {
                echo 
    "mail sent to ";
                echo 
    $to;
                }
            }
    ?>

  2. #2
    SitePoint Addict Wildhoney's Avatar
    Join Date
    Apr 2006
    Location
    Nottingham
    Posts
    246
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    ...
    $bStatus mail($to$subject$message$headers);
    if(!
    $bStatus)
    ... 
    TalkPHP.com - The Friendly PHP Community

    Watch Reaper Online - Watch Chuck Online


Bookmarks

Posting Permissions

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