sending mail in php problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Tinus
    New Member
    • Jul 2010
    • 30

    sending mail in php problem

    Dear friends

    I am trying to sendd a mail from my php code:
    php gives a message that the mail was send successfully but nothing is actually sended.("i receive nothing")

    Thanks you for the help!

    Code:
    $to = "bbesa@aol.com";
    $subject = "BWI SHARE RESULTS!";
    $body = $theData;
    $from="bbesa@aol.com";
    $headers = "From: .$from";
    if (mail($to,$subject,$message,$headers)) {
    echo("<p>Message successfully sent!</p>");
    } 
    else 
    {
    echo("<p>Message delivery failed...</p>");
    }
    My phpinfo() is saying
    Configuration File (php.ini) Path no value

    Loaded Configuration File C:\aptana\xampp-win32-1.7.3\xampp\php \php.ini


    My php.ini

    Code:
    [mail function]
    ; For Win32 only.
    ; http://php.net/smtp
    SMTP = something.something.ac.za
    ; http://php.net/smtp-port
    smtp_port=234
    
    ; For Win32 only.
    ; http://php.net/sendmail-from
    
    sendmail_from = 12552690@nwu.ac.za
    
    ; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
    ; http://php.net/sendmail-path
    
    sendmail_path = “C:\aptana\xampp-win32-1.7.3\xampp\sendmail\sendmail.exe -t”
    
    ; Force the addition of the specified parameters to be passed as extra parameters
    ; to the sendmail binary. These parameters will always replace the value of
    ; the 5th parameter to mail(), even in safe mode.
    ;mail.force_extra_parameters =
    
    ; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename
    mail.add_x_header = Off
    
    ; Log all mail() calls including the full path of the script, line #, to address and headers
    mail.log = "\aptana\xampp-win32-1.7.3\xampp\apache\logs\php_mail.log"
    sendmail.ini

    logfile "\aptana\xa mpp-win32-1.7.3\xampp\sen dmail\sendmail. log"

    smtp_server=smt p.aol.com
    smtp_port=587
    auth_username=b besa@aol.com
    auth_password=p assword1234
  • JKing
    Recognized Expert Top Contributor
    • Jun 2007
    • 1206

    #2
    Did you check your junk mail?

    Comment

    • Tinus
      New Member
      • Jul 2010
      • 30

      #3
      Hi Jking

      Yes,also nothing in spam.
      Line 6 has been changed to
      if (mail($to,$subj ect,$body,$head ers))

      But it is still not working.

      Comment

      • Thew
        New Member
        • Aug 2010
        • 69

        #4
        Not all headers are set, set all headers or leave them away...
        and:

        $headers = "From: .$from";
        Keep variables out of the quotes:
        $headers = "From: ".$from;

        Comment

        • Tinus
          New Member
          • Jul 2010
          • 30

          #5
          Thanks for the reply

          My php file looks as follow and I have also changed sendmail.ini:

          Code:
          $from_name = "BESAWEB";
          $from_email= "1232690@nwk.ac.za";
          $headers   = "From: $from_email";
          $body      = "Hi, \n This is a test mail from $from_name <$from_email>.";
          $subject   = "Test mail from besa";
          $to        = "1232690@nwk.ac.za";
          if (mail($to, $subject, $body, $headers)) 
          {echo "mail success!";} 
          else {echo "mail fail…";}
          Why is phpinfo saying configuration File (php.ini) Path no value ?

          Comment

          Working...