本文整理汇总了C#中acUI.acUI.SendEmailMessage方法的典型用法代码示例。如果您正苦于以下问题:C# acUI.acUI.SendEmailMessage方法的具体用法?C# acUI.acUI.SendEmailMessage怎么用?C# acUI.acUI.SendEmailMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类acUI.acUI
的用法示例。
在下文中一共展示了acUI.acUI.SendEmailMessage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: wmSendEmail
public string wmSendEmail(string sTo, string sFrom, string sSubject, string sBody)
{
acUI.acUI ui = new acUI.acUI();
string sMsg = "";
ui.SendEmailMessage(sTo, sFrom, sSubject, sBody, ref sMsg);
return sMsg;
}
示例2: wmSendErrorReport
public void wmSendErrorReport(string sMessage, string sPageDetails)
{
acUI.acUI ui = new acUI.acUI();
string sErr = "";
string sTo = (string)ui.GetSessionObject("admin_email", "Security");
if (!string.IsNullOrEmpty(sTo) && !string.IsNullOrEmpty(sMessage))
{
string sFrom = "[email protected]" + Server.MachineName.ToString();
sMessage = ui.unpackJSON(sMessage);
ui.SendEmailMessage(sTo, sFrom, "UI Error Report", sMessage + Environment.NewLine + Environment.NewLine + sPageDetails, ref sErr);
}
return;
}
示例3: SaveNotifications
//.........这里部分代码省略.........
string sOrigSMTPUserAccount = "";
string sOrigSMTPServerPort = "";
string sOrigFromEmail = "";
string sOrigFromName = "";
string sOrigAdminEmail = "";
string sSQL = "select mode_off_on, loop_delay_sec, retry_delay_min, retry_max_attempts," +
" smtp_server_addr, smtp_server_user, smtp_server_password, smtp_server_port, from_email, from_name, admin_email" +
" from messenger_settings" +
" where id = 1";
DataTable dt = new DataTable();
if (!dc.sqlGetDataTable(ref dt, sSQL, ref sErr))
{
return "Unable to continue. " + sErr;
}
if (dt.Rows.Count > 0)
{
DataRow dr = dt.Rows[0];
sOrigMessengerOnOff = dr["mode_off_on"].ToString();
sOrigPollLoop = dr["loop_delay_sec"].ToString();
sOrigRetryDelay = dr["retry_delay_min"].ToString();
sOrigRetryMaxAttempts = dr["retry_max_attempts"].ToString();
sOrigSMTPServerAddress = dr["smtp_server_addr"].ToString();
sOrigSMTPUserAccount = dr["smtp_server_user"].ToString();
sOrigSMTPServerPort = dr["smtp_server_port"].ToString();
sOrigFromEmail = dr["from_email"].ToString();
sOrigFromName = dr["from_name"].ToString();
sOrigAdminEmail = dr["admin_email"].ToString();
}
sSQL = "update messenger_settings set mode_off_on='{0}', loop_delay_sec={1}, retry_delay_min={2}, retry_max_attempts={3}, smtp_server_addr='{4}', smtp_server_user='{5}', smtp_server_port={6}, from_email='{7}', from_name='{8}', admin_email='{9}'";
//only update password if it has been changed.
string sPasswordFiller = "($%#[email protected]!&";
if (sSMTPUserPassword != sPasswordFiller)
{
sSQL += ",smtp_server_password='{10}'";
}
sSQL = string.Format(sSQL, sMessengerOnOff, sPollLoop, sRetryDelay, sRetryMaxAttempts, sSMTPServerAddress, sSMTPUserAccount, sSMTPServerPort, sFromEmail, sFromName, sAdminEmail, dc.EnCrypt(sSMTPUserPassword));
if (!dc.sqlExecuteUpdate(sSQL, ref sErr))
{
return "Update failed: " + sErr;
}
else
{
//logging
var sLogObject = "Manage Notifications";
ui.WriteObjectChangeLog(acObjectTypes.None, sLogObject, "Messenger On / Off", sOrigMessengerOnOff, sMessengerOnOff);
ui.WriteObjectChangeLog(acObjectTypes.None, sLogObject, "Poll Loop", sOrigPollLoop, sPollLoop);
ui.WriteObjectChangeLog(acObjectTypes.None, sLogObject, "Retry Delay", sOrigRetryDelay, sRetryDelay);
ui.WriteObjectChangeLog(acObjectTypes.None, sLogObject, "Retry Max Attempts", sOrigRetryMaxAttempts, sRetryMaxAttempts);
ui.WriteObjectChangeLog(acObjectTypes.None, sLogObject, "SMTP Server Address", sOrigSMTPServerAddress, sSMTPServerAddress);
ui.WriteObjectChangeLog(acObjectTypes.None, sLogObject, "SMTP User Account", sOrigSMTPUserAccount, sSMTPUserAccount);
ui.WriteObjectChangeLog(acObjectTypes.None, sLogObject, "SMTP Server Port", sOrigSMTPServerPort, sSMTPServerPort);
ui.WriteObjectChangeLog(acObjectTypes.None, sLogObject, "From Email", sOrigFromEmail, sFromEmail);
ui.WriteObjectChangeLog(acObjectTypes.None, sLogObject, "From Name", sOrigFromName, sFromName);
ui.WriteObjectChangeLog(acObjectTypes.None, sLogObject, "From Name", sOrigAdminEmail, sAdminEmail);
// send a notification to the user that made the change
if (sMessengerOnOff == "on")
{
// get the users email, if they do not have an email tell them no message was created.
string sUsersEmail = null;
string sUserID = ui.GetSessionUserID();
sSQL = "select email from users where user_id = '" + sUserID + "'";
if (!dc.sqlGetSingleString(ref sUsersEmail, sSQL, ref sErr))
{
return "Unable to create test email: " + sErr;
}
string sUserName = "";
sUserName = ui.GetSessionUserFullName();
if (string.IsNullOrEmpty(sUsersEmail) || sUsersEmail.Length < 5)
{
// all good, no email so notify user
return "Notification settings updated.\n\nNo email on file for user " + sUserName + " - unable to send a test message";
}
else
{
// create a test email
ui.SendEmailMessage(sUsersEmail,
ag.APP_COMPANYNAME + " Account Management",
ag.APP_COMPANYNAME + " Messenger configuration change.",
"<html><head></head><body><p>" + sUserName + ",</p><p>This is a test mail to confirm the smtp server that you have configured.</p><p>Do not reply to this message, and feel free to delete it.</p><p>Regards,\n\n" + ag.APP_COMPANYNAME + " Administration team.</p></body></html>", ref sErr);
if (sErr != "")
{
return "Update completed. Unable to create test message: " + sErr;
}
}
return "Notification settings updated. A test email will be sent to " + sUsersEmail + ".";
}
else
{
return "Notification settings updated.";
}
}
}