/framework/vendor/swift/lib/classes/Swift/Transport/SimpleMailInvoker.php

http://zoop.googlecode.com/ · PHP · 58 lines · 15 code · 5 blank · 38 comment · 1 complexity · 9cfc6ec6a21a9855cad202966f5a3a77 MD5 · raw file

  1. <?php
  2. /*
  3. Invokes the mail() function in Swift Mailer.
  4. This program is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation, either version 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. //@require 'Swift/Transport/MailInvoker.php';
  16. /**
  17. * This is the implementation class for {@link Swift_Transport_MailInvoker}.
  18. *
  19. * @package Swift
  20. * @subpackage Transport
  21. * @author Chris Corbyn
  22. */
  23. class Swift_Transport_SimpleMailInvoker implements Swift_Transport_MailInvoker
  24. {
  25. /**
  26. * Send mail via the mail() function.
  27. *
  28. * This method takes the same arguments as PHP mail().
  29. *
  30. * @param string $to
  31. * @param string $subject
  32. * @param string $body
  33. * @param string $headers
  34. * @param string $extraParams
  35. *
  36. * @return boolean
  37. */
  38. public function mail($to, $subject, $body, $headers = null, $extraParams = null)
  39. {
  40. if (!ini_get('safe_mode'))
  41. {
  42. return mail($to, $subject, $body, $headers, $extraParams);
  43. }
  44. else
  45. {
  46. return mail($to, $subject, $body, $headers);
  47. }
  48. }
  49. }