Changeset 526

Show
Ignore:
Timestamp:
01/23/08 01:32:07 (1 year ago)
Author:
areski
Message:

BUG : Return path not set in email sending out invoices - reported by middletn ticket #182

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.3/A2Billing_UI/lib/defines.php

    r409 r526  
    188188        unset($fileatt_type); 
    189189        unset($fileatt_name); 
    190         $ok = @mail($email_to, $email_subject, $email_message, $headers); 
     190         
     191        if (email_from != "" && PHP_VERSION >= "4.0") { 
     192                $old_from = ini_get("sendmail_from"); 
     193                ini_set("sendmail_from", $email_from); 
     194        } 
     195 
     196        if (email_from != "" && PHP_VERSION >= "4.0.5") { 
     197                // The fifth parameter to mail is only available in PHP >= 4.0.5 
     198                $params = sprintf("-oi -f %s", $email_from); 
     199                $ok = @mail($email_to, $email_subject, $email_message, $headers, $params); 
     200        } else { 
     201                $ok = @mail($email_to, $email_subject, $email_message, $headers); 
     202        } 
    191203        return $ok; 
    192204} 
  • trunk/A2Billing_UI/lib/defines.php

    r440 r526  
    203203        unset($fileatt_type); 
    204204        unset($fileatt_name); 
    205         $ok = @mail($email_to, $email_subject, $email_message, $headers); 
     205         
     206        if (email_from != "" && PHP_VERSION >= "4.0") { 
     207                $old_from = ini_get("sendmail_from"); 
     208                ini_set("sendmail_from", $email_from); 
     209        } 
     210 
     211        if (email_from != "" && PHP_VERSION >= "4.0.5") { 
     212                // The fifth parameter to mail is only available in PHP >= 4.0.5 
     213                $params = sprintf("-oi -f %s", $email_from); 
     214                $ok = @mail($email_to, $email_subject, $email_message, $headers, $params); 
     215        } else { 
     216                $ok = @mail($email_to, $email_subject, $email_message, $headers); 
     217        } 
    206218        return $ok; 
    207219} 


Google