Skip to content

Use stored PW for Test Email feature #31515

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions administrator/components/com_config/model/application.php
Original file line number Diff line number Diff line change
Expand Up @@ -912,12 +912,12 @@ public function storePermissions($permission = null)
public function sendTestMail()
{
// Set the new values to test with the current settings
$app = JFactory::getApplication();
$input = $app->input;
$app = JFactory::getApplication();
$input = $app->input;
$smtppass = $input->get('smtppass', '', 'RAW');

$app->set('smtpauth', $input->get('smtpauth'));
$app->set('smtpuser', $input->get('smtpuser', '', 'STRING'));
$app->set('smtppass', $input->get('smtppass', '', 'RAW'));
$app->set('smtphost', $input->get('smtphost'));
$app->set('smtpsecure', $input->get('smtpsecure'));
$app->set('smtpport', $input->get('smtpport'));
Expand All @@ -926,6 +926,12 @@ public function sendTestMail()
$app->set('mailer', $input->get('mailer'));
$app->set('mailonline', $input->get('mailonline'));

// Use smtppass only if it was submitted
if ($smtppass)
{
$app->set('smtppass', $smtppass);
}

$mail = JFactory::getMailer();

// Prepare email and send try to send it
Expand Down