mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-18 22:47:21 -06:00
Add button for sending test email
This allows for easily testing whether the provided email configuration is correct. PR #20488.
This commit is contained in:
committed by
Chocobo1
parent
1702b6c891
commit
c06817f4eb
@@ -680,6 +680,24 @@ void Application::sendNotificationEmail(const BitTorrent::Torrent *torrent)
|
||||
content);
|
||||
}
|
||||
|
||||
void Application::sendTestEmail() const
|
||||
{
|
||||
const Preferences *pref = Preferences::instance();
|
||||
if (pref->isMailNotificationEnabled())
|
||||
{
|
||||
// Prepare mail content
|
||||
const QString content = tr("This is a test email.") + u'\n'
|
||||
+ tr("Thank you for using qBittorrent.") + u'\n';
|
||||
|
||||
// Send the notification email
|
||||
auto *smtp = new Net::Smtp();
|
||||
smtp->sendMail(pref->getMailNotificationSender(),
|
||||
pref->getMailNotificationEmail(),
|
||||
tr("Test email"),
|
||||
content);
|
||||
}
|
||||
}
|
||||
|
||||
void Application::torrentAdded(const BitTorrent::Torrent *torrent) const
|
||||
{
|
||||
const Preferences *pref = Preferences::instance();
|
||||
|
||||
Reference in New Issue
Block a user