This mail script is not working... help please

Discussion in 'PHP' started by durgesh871, Jun 30, 2010.

  1. #1
    HI I used this script on my site...

    this is the script i am using

    
    
    <?php
    
    $from = "info@XXXXX.com";
    $from_name = "Website Visitor";
    $subject = "Contact Form";
    
    $to = "shail@iiml.ac.in"$_POST['email'];
    
    // collect data
    $body = "";
    foreach($_POST as $key => $val)
    {
    if($key != 'captcha')
    $body .= ucfirst($key).": ".$val."\r\n";
    }
    
    // construct MIME PLAIN Email headers
    $header = "MIME-Version: 1.0\n";
    $header .= "Content-type: text/plain; charset=utf-8\n";
    $header .= "From: $from_name <$from>\r\nReply-To: $from_name <$from>\r\nReturn-Path: <$from>\r\n";
    
    // send email
    $mail_sent = mail($to, $subject, $body, $header);
    ?>
    
    
    Code (markup):
     
    durgesh871, Jun 30, 2010 IP
  2. imperialDirectory

    imperialDirectory Peon

    Messages:
    395
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Are you running a Linux server or Windows server?
     
    imperialDirectory, Jun 30, 2010 IP
  3. danx10

    danx10 Peon

    Messages:
    1,179
    Likes Received:
    44
    Best Answers:
    2
    Trophy Points:
    0
    #3
    $to = "shail@iiml.ac.in"$_POST['email'];
    PHP:
    what is that??? lookup string concatenation.
     
    danx10, Jun 30, 2010 IP
  4. ASUService

    ASUService Member

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #4
    Wondered about that myself!!!
     
    ASUService, Jun 30, 2010 IP
  5. strgraphics

    strgraphics Active Member

    Messages:
    710
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #5
    Did you got or not..

    the $to should be

     $to = "shail@iiml.ac.in"; 
    PHP:
    or you can use

    $to = $_POST['email'];
    PHP:
    use either one....!

     
    strgraphics, Jun 30, 2010 IP