Properly support MAIL_USE_F_PARAM in new API
authorTim Düsterhus <duesterhus@woltlab.com>
Tue, 14 Jun 2016 21:19:20 +0000 (23:19 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Tue, 14 Jun 2016 21:19:20 +0000 (23:19 +0200)
wcfsetup/install/files/lib/system/email/transport/PhpEmailTransport.class.php

index 2713f8730f0578db5883030e92f36f878e7d92e0..2f649ffd11f99b1fddc2fa9b673f148023145467 100644 (file)
@@ -40,6 +40,11 @@ class PhpEmailTransport implements EmailTransport {
                        return implode(': ', $item);
                }, $headers));
                
-               mail($envelopeTo->getAddress(), $email->getSubject(), StringUtil::unifyNewlines($email->getBodyString()), $headers, '-f'.$email->getSender()->getAddress());
+               if (MAIL_USE_F_PARAM) {
+                       mail($envelopeTo->getAddress(), $email->getSubject(), StringUtil::unifyNewlines($email->getBodyString()), $headers, '-f'.$email->getSender()->getAddress());
+               }
+               else {
+                       mail($envelopeTo->getAddress(), $email->getSubject(), StringUtil::unifyNewlines($email->getBodyString()), $headers);
+               }
        }
 }