Menu

Vacation replay to email sent from php

9evill
2011-05-09
2013-01-23
  • 9evill

    9evill - 2011-05-09

    Hello all,
    If i send message from php to user who enabled autoresponder, vacation message goes not to email defined in headers, but to system email php send mail from like apache@hostname.com or www-data@servername.com

    Here is a code iam using to send message:

    <?php
    $message = 'test';
    $headers  = 'MIME-Version: 1.0'.PHP_EOL;
    $headers .= 'Content-type: text/plain; charset=windows-1257'.PHP_EOL;
    $headers .= 'From: test <user@domain.com>'.PHP_EOL;
    $headers .= 'Return-Path: user@domain.com'.PHP_EOL;
    mail('otheruser@otherdomain.com','test',$message,$headers);
    ?>
    As you see from headers, vacation message should be sended to user@domain.com, but in logs i see what it goes to apache@servername.com
    Any thoughts?
    Thanks.

     
  • Simon Hobson

    Simon Hobson - 2011-05-09

    Fix your PHP/Apache setup !

    In your Apache site config, put something like this :

    php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f user@domain.com -F 'Real Name'"
    

    It also means you/your users will get bounce messages as well, instead of them being sent to the Apache user.

     
  • 9evill

    9evill - 2011-05-09

    I cant fix it, php script is in hosting company.
    If i use old vacation script version 3.2 everything is working fine. But if i update to 4.0, i get these problems.

     
  • 9evill

    9evill - 2011-05-09

    ANd what if i want to send email with php from two or more different emails? Your fix is for only one email.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.