SimpleMailInvoker.php 1006 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /*
  3. * This file is part of SwiftMailer.
  4. * (c) 2004-2009 Chris Corbyn
  5. *
  6. * For the full copyright and license information, please view the LICENSE
  7. * file that was distributed with this source code.
  8. */
  9. /**
  10. * This is the implementation class for {@link Swift_Transport_MailInvoker}.
  11. *
  12. * @author Chris Corbyn
  13. */
  14. class Swift_Transport_SimpleMailInvoker implements Swift_Transport_MailInvoker
  15. {
  16. /**
  17. * Send mail via the mail() function.
  18. *
  19. * This method takes the same arguments as PHP mail().
  20. *
  21. * @param string $to
  22. * @param string $subject
  23. * @param string $body
  24. * @param string $headers
  25. * @param string $extraParams
  26. *
  27. * @return bool
  28. */
  29. public function mail($to, $subject, $body, $headers = null, $extraParams = null)
  30. {
  31. if (!ini_get('safe_mode')) {
  32. return @mail($to, $subject, $body, $headers, $extraParams);
  33. } else {
  34. return @mail($to, $subject, $body, $headers);
  35. }
  36. }
  37. }