Skip to content

Commit 89192b5

Browse files
authored
[4.0] Fix JMail workaround for opportunistic tls (#24886)
1 parent f9bbd3f commit 89192b5

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

libraries/src/Mail/Mail.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public static function getInstance($id = 'Joomla', $exceptions = true)
100100
* @since 1.7.0
101101
*
102102
* @throws \RuntimeException if the mail function is disabled
103-
* @throws phpmailerException if sending failed and exception throwing is enabled
103+
* @throws phpmailerException if sending failed
104104
*/
105105
public function Send()
106106
{
@@ -133,7 +133,17 @@ public function Send()
133133
*/
134134
if (!$result && $this->SMTPAutoTLS)
135135
{
136-
throw new \RuntimeException(Text::_($this->ErrorInfo), 500);
136+
$this->SMTPAutoTLS = false;
137+
138+
try
139+
{
140+
$result = parent::send();
141+
}
142+
finally
143+
{
144+
// Reset the value for any future emails
145+
$this->SMTPAutoTLS = true;
146+
}
137147
}
138148

139149
return $result;

0 commit comments

Comments
 (0)