mail from php not working

Discussion in 'Installation/Configuration' started by cotthemh, Mar 12, 2007.

  1. cotthemh

    cotthemh New Member

    When i try to send a mail from php i get the following message in /var/log/maillog :
    Mar 12 23:34:43 gargamel postfix/smtpd[30074]: disconnect from localhost.localdomain[127.0.0.1]
    Mar 12 23:34:46 gargamel sendmail[30168]: l2CMYkIq030168: from=apache, size=253, class=0, nrcpts=0, msgid=<[email protected]>, relay=apache@localhost


    but the mail does not get delivered, any idea what goes wrong ? the code used to work nicely on a windows server :
    $from = "[email protected]";
    ini_set("sendmail_from",$from);
    $to = $clubemail;
    $subject = "De gegevens van " . $nelosledenupd->Naam->getValue() . " werden aangepast ";
    $message = "De gegevens van " . $nelosledenupd->Voornaam->getValue(). " " .$nelosledenupd->Naam->getValue() . " \n" .
    "Deze mail dient uitsluitend als informatie u hoeft verder niets te doen ";
    $additional_headers = "From: $from\nReply-To: $from\nContent-Type: text/html";
    mail ($to, $subject, $message, $additional_headers);


    any clue is highly appreciated,

    herwig
     
  2. falko

    falko Super Moderator Howtoforge Staff

    Are there any errors in your mail log?
    What's the output of
    Code:
    netstat -tap
    ?
     
  3. cotthemh

    cotthemh New Member

    there seemed to be a problem with the to adress which was ill formated, the second problem is that the mail scores 3.8 for spamassassin so is likely to be thrown out, any clue why ?

    many thanks for you're advice and idea's !!!

    herwig
     
  4. falko

    falko Super Moderator Howtoforge Staff

    If SpamAssassin marks these mails as spam, you can take a look at the email header to see which SpamAssassin tests were negative. If you know the tests, you can then modify your mail function so that the mails pass SpamAssassin.
     
  5. tellar

    tellar New Member

    try this

    ini_set("sendmail_from",$from);


    change it to ini_set("from",$from);

    worked for me
     

Share This Page