Exemple #1
0
void Email::pdfCreated()
{
    Smtp* smtp = new Smtp(this);
    connect(smtp, SIGNAL(mailSent()), this, SLOT(mailSent()));
    connect(smtp, SIGNAL(error(QString)), this, SLOT(mailError(QString)));
    connect(smtp, SIGNAL(finished()), smtp, SLOT(deleteLater()));
    smtp->sendFile(*sendSettings, *emailSettings, tempFile->fileName());
}
void MainWindow::sendMail()
{
    Smtp* smtp = new Smtp(ui->uname->text(), ui->paswd->text(), ui->server->text(), ui->port->text().toInt());
    connect(smtp, SIGNAL(status(QString)), this, SLOT(mailSent(QString)));


    smtp->sendMail(ui->uname->text(), ui->rcpt->text() , ui->subject->text(),ui->msg->toPlainText());
}
void MainWindow::sendMail()
{
    Smtp* smtp = new Smtp(settings.value("uname").toString(), settings.value("pswd").toString(),
                          settings.value("Server").toString(), settings.value("port").toInt());
    connect(smtp, SIGNAL(status(QString)), this, SLOT(mailSent(QString)));

    if( !file_attachments.isEmpty() )
    {
        //smtp->sendMail(settings.value("uname").toString(), settings.value("email to").toString(), ui->subject->text(),ui->msg->toPlainText(), file_attachments );
    }
    else
    {
        smtp->sendMail(settings.value("uname").toString(), settings.value("email to").toString(), ui->subject->text(),ui->msg->toPlainText());
        //smtp->sendMail(ui->uname->text(), ui->rcpt->text(), ui->subject->text(),ui->msg->toPlainText());
    }
    qDebug("finished sendmail");
}
bool UserManagementAPI::sendPasswordResetEmail(const QString &to, const QString &resetCode)
{
    if (SettingsManager::getSingleton().has("SMTP/username")
            || SettingsManager::getSingleton().has("SMTP/password")
            || SettingsManager::getSingleton().has("SMTP/server")
            || SettingsManager::getSingleton().has("SMTP/from"))
    {
        QString username = SettingsManager::getSingleton().get("SMTP/username").toString();
        QString password = SettingsManager::getSingleton().get("SMTP/password").toString();
        QString server = SettingsManager::getSingleton().get("SMTP/server").toString();
        SmtpManager *smtp = new SmtpManager(username, password, server);
        connect(smtp, SIGNAL(status(QString)), this, SLOT(mailSent(QString)));

        QString emailContent = "http://*****:*****@gmail.com", to, "Reset Swiftly", emailContent);
        sLog() << "Send password reset email to:" << to << "with reset code:" << resetCode;
        return true;
    }

    return false;
}
Exemple #5
0
void SmsClient::finished( const QString& id, QTelephony::Result result )
{
    QMap<QString, RawSms>::iterator it = sentMessages.find(id);
    if (it != sentMessages.end()) {
        // Report this message back as 'processed', whether transmission succeeded or not
        emit messageProcessed(it->msgId);

        sentMessages.erase(it);
    } else {
        qWarning() << "SMS: Cannot process unknown message:" << id;
    }

    if ( result != QTelephony::OK )
        success = false;

    ++count;
    if ( count >= total ) {
        if ( success )
            emit mailSent( count );
        else
            emit transmissionCompleted();
    }
}