本文整理汇总了C++中MailSender::send方法的典型用法代码示例。如果您正苦于以下问题:C++ MailSender::send方法的具体用法?C++ MailSender::send怎么用?C++ MailSender::send使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MailSender
的用法示例。
在下文中一共展示了MailSender::send方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: deleteCalibRequestFile
void ColorKeeperModel::deleteCalibRequestFile(string screenFullName,
const unsigned int &screenIndex) {
QFile calibRequestFile(
QString::fromStdString(
ColorKeeperModel::getCalibRequestFilePath(screenFullName)));
if (calibRequestFile.exists()) {
calibRequestFile.remove();
const ILocalHost &host = ColorKeeperModel::Instance().getDeviceInfo();
QString osName;
#ifdef __WIN32__
osName = "Windows";
#endif
#ifdef __linux__
osName = "Linux";
#endif
#ifdef __APPLE__
osName = "MacOSX";
#endif
QString hostname = QString(host.getHostName().c_str());
QString domain = QString(host.getDomainName().c_str());
bool isHighPriority = false;
map<unsigned int, HealerCalibModel>::iterator calibIt =
ColorKeeperModel::Instance()._calib.find(screenIndex);
if (calibIt != ColorKeeperModel::Instance()._calib.end()) {
isHighPriority = (*calibIt).second.isHighPriority();
}
MailSender* mailer = ColorKeeperModel::Instance().getMailer();
if (mailer == NULL)
return;
//CalibRequest
QString title = "CalibRequest For " + hostname + " on " + osName;
if (isHighPriority)
title = "URGENT " + title;
QString message =
"[CLOSED]\nMessage send by ColorKeeper after a calibration with ColorHealer.";
mailer->send(QString::fromLocal8Bit(title.toStdString().c_str()),
QString::fromLocal8Bit(message.toStdString().c_str()));
}
}
示例2: sendAMailCalibrationRequest
void ColorKeeperModel::sendAMailCalibrationRequest() {
MailSender* mailer = ColorKeeperModel::Instance().getMailer();
if (mailer == NULL) {
ostringstream os;
os << "\nCoudn't find mailer configuration.\n" << endl;
ColorKeeperModel::logMessage(os.str());
return;
}
const ILocalHost &host = getDeviceInfo();
const vector<unsigned int> & screenOrder = getScreenResOrder();
QStringList screensToCalibrate;
QStringList screensToCalibrateFullNames;
bool isHighPriority = false;
for (unsigned int i = 0; i < screenOrder.size(); i++) {
const ZooperDisplayDevice & dispDev = host.getCalibrableDisplayDevice(
screenOrder[i]);
string fullname = dispDev.getFullName(false);
if (isCalibResquestAsked(fullname)
|| isScreenModelInvalidate(dispDev.getManufacturerName(),
dispDev.getModelName()) || isMachineInvalidate())
continue;
int isHasBeen = isScreenCorrectionHasBeen(dispDev.getOSIndex());
bool isNotCorrected = !isScreenCorrected(dispDev.getOSIndex());
if (isHasBeen > 0) {
QString message = "";
message += "Average Priority : "
+ QString(dispDev.getFullName().c_str()) + " has a "
+ QString::number(isHasBeen)
+ " days obsolete profile and need to be re-calibrate.";
// QString message = "";
// message
// += "" + QString(
// dispDev.getFullName().c_str())
// + " has no calibration profile and need to be calibrate very quickly.";
screensToCalibrate << message;
screensToCalibrateFullNames << QString::fromStdString(fullname);
} else if (isNotCorrected) {
QString message = "";
message +=
"High Priority : " + QString(dispDev.getFullName().c_str())
+ " has no calibration profile and need to be calibrate very quickly.";
screensToCalibrate << message;
screensToCalibrateFullNames << QString::fromStdString(fullname);
isHighPriority = true;
}
}
int nbScreensToCalibrate = screensToCalibrate.size();
if (nbScreensToCalibrate > 0) {
QString osName;
#ifdef __WIN32__
osName = "Windows";
#endif
#ifdef __linux__
osName = "Linux";
#endif
#ifdef __APPLE__
osName = "MacOSX";
#endif
QString hostname = QString(host.getHostName().c_str());
QString domain = QString(host.getDomainName().c_str());
QString message =
"Dear calibrators,\n\nColorKeeper has detected a lack of calibration for machine "
+ hostname + " (domain : " + domain + ", user : "
+ QString(host.getUserName().c_str()) + " ) on "
+ osName + " : \n";
//CalibRequest
QString title = "CalibRequest For " + hostname + " on " + osName;
if (isHighPriority)
title = "URGENT " + title;
for (int i = 0; i < nbScreensToCalibrate; i++) {
message += "- " + screensToCalibrate.at(i) + "\n";
ColorKeeperModel::createCalibRequestAskedFile(
screensToCalibrateFullNames.at(i).toStdString(),
message.toStdString());
}
message += "\nThanks !\n\n";
#ifdef __linux__
message += "Reminder : on Linux, only one screen can be calibrated, ColorKeeper choose the primary screen in Nvidia-settings.\nSo when you're calibrating a dual screen linux station, check first that the primary screen if the best of the two (if not change the primary screen setting in Nivdia-settings).\n\n";
#endif
mailer->send(QString::fromLocal8Bit(title.toStdString().c_str()),
QString::fromLocal8Bit(message.toStdString().c_str()));
ColorKeeperModel::logMessage("\nA request calib mail was sent.\n");
}
}