Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: joomla/joomla-platform
base: 97cdd2c744
...
head fork: joomla/joomla-platform
compare: e03fee2883
Checking mergeability… Don't worry, you can still create the pull request.
  • 5 commits
  • 1 file changed
  • 0 commit comments
  • 2 contributors
Commits on Apr 01, 2012
Amy Stephen Mail package: Exception and JError d89baaa
Amy Stephen Merge c83feeb
Commits on Apr 02, 2012
Amy Stephen Append message from phpMailer f8138ac
Commits on Apr 03, 2012
@eddieajau eddieajau Merge branch 'mail' of https://github.com/AmyStephen/joomla-platform
…into AmyStephen-mail
3ccb925
@eddieajau eddieajau Format exception messages. e03fee2
Showing with 18 additions and 4 deletions.
  1. +18 −4 libraries/joomla/mail/mail.php
View
22 libraries/joomla/mail/mail.php
@@ -67,23 +67,37 @@ public static function getInstance($id = 'Joomla')
/**
* Send the mail
*
- * @return mixed True if successful, a JError object otherwise
+ * @return mixed True if successful; JError if using legacy tree (no exception thrown in that case).
*
* @since 11.1
+ * @throws RuntimeException
*/
public function Send()
{
if (($this->Mailer == 'mail') && !function_exists('mail'))
{
- return JError::raiseNotice(500, JText::_('JLIB_MAIL_FUNCTION_DISABLED'));
+ if (class_exists('JError'))
+ {
+ return JError::raiseNotice(500, JText::_('JLIB_MAIL_FUNCTION_DISABLED'));
+ }
+ else
+ {
+ throw new RuntimeException(sprintf('%s::Send mail not enabled.'), get_class($this));
+ }
}
@$result = parent::Send();
if ($result == false)
{
- // TODO: Set an appropriate error number
- $result = JError::raiseNotice(500, JText::_($this->ErrorInfo));
+ if (class_exists('JError'))
+ {
+ $result = JError::raiseNotice(500, JText::_($this->ErrorInfo));
+ }
+ else
+ {
+ throw new RuntimeException(sprintf('%s::Send failed: "%s".'), get_class($this), $this->ErrorInfo);
+ }
}
return $result;

No commit comments for this range

Something went wrong with that request. Please try again.