Set mail sender for each website

Discussion in 'ISPConfig 3 Priority Support' started by aldo, Nov 18, 2013.

  1. aldo

    aldo Member HowtoForge Supporter

    How can I set mail sender for each website?

    Now all e-mails sent through the PHP mail() function have a sender like:
    but I would like something like that is:
    Set the email headers, as described below, has no effect...
    PHP:
    ...
    $from "[email protected]";
    $headers "From: " $from "\r\n";
    $headers .= "Reply-To: " $from "\r\n";
    $headers .= "Return-Path: " $from "\r\n";
    ...
    if (
    mail($to$subject$body$headers)) {
    ...
    ... the recipient smtp server sees:
    I'm using Debian6 + ISPConfig3.0.5.3 + Postifix2.7.1


    Thanks.
     
  2. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    You could set the sender as admin in the website options tab -> php.ini
    There you could enter something like:
    sendmail_path = sendmail -t -i -f [email protected]
     
  3. aldo

    aldo Member HowtoForge Supporter

    Hi Croydon,
    I tried
    sendmail_path = sendmail -t -i -F [email protected]
    and also
    sendmail_from = [email protected]
    with no luck.

    I also checked that php.ini of the website (/var/www/conf/web21 in the example) contain the changes and I found them, but it seems to have no effect.
     
  4. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    I said -f and not -F :)

    sendmail_from is for windows.
     
  5. aldo

    aldo Member HowtoForge Supporter

    Marius, you are right.
    -f works.
    Thanks!
     
  6. aldo

    aldo Member HowtoForge Supporter

    Searching in vain for the meaning of the arguments
    I also found this way so I tried it and it works.
    PHP:
    mail($to$subject$message$headers"-f$from");
     

Share This Page