mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-11 15:56:17 -07: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:
parent
1702b6c891
commit
c06817f4eb
9 changed files with 67 additions and 1 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue