本文整理汇总了C#中MailPriority类的典型用法代码示例。如果您正苦于以下问题:C# MailPriority类的具体用法?C# MailPriority怎么用?C# MailPriority使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MailPriority类属于命名空间,在下文中一共展示了MailPriority类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: EmailTemplate
public EmailTemplate(XmlNode rootNode)
{
XmlNode namedItem = rootNode.Attributes.GetNamedItem("priority");
MailPriority mailPriority;
if (namedItem != null && System.Enum.TryParse<MailPriority>(namedItem.InnerText, out mailPriority))
{
this.priority = mailPriority;
}
namedItem = rootNode.Attributes.GetNamedItem("templateName");
if (namedItem != null)
{
this.templateName = namedItem.InnerText;
}
XmlNode xmlNode = rootNode.SelectSingleNode("subject");
if (xmlNode != null)
{
this.subject = xmlNode.InnerText;
}
XmlNode xmlNode2 = rootNode.SelectSingleNode("from");
if (xmlNode2 != null)
{
this.From = xmlNode2.InnerText;
}
XmlNode xmlNode3 = rootNode.SelectSingleNode("body");
if (xmlNode3 != null)
{
namedItem = xmlNode3.Attributes.GetNamedItem("url");
if (namedItem != null)
{
this.BodyUrl = namedItem.InnerText;
return;
}
this.Body = xmlNode3.InnerXml;
}
}
开发者ID:hbulzy,项目名称:SYS,代码行数:35,代码来源:EmailTemplate.cs
示例2: SendEmail
public bool SendEmail(string subject, IList<string> userList, IList<string> ccList, string body, MailPriority priority = MailPriority.Normal)
{
var mail = new MailMessage
{
From = fromAddress,
Subject = subject,
Body = body,
BodyEncoding = Encoding.UTF8,
IsBodyHtml = true,
Priority = priority
};
foreach (var user in userList)
mail.To.Add(user);
foreach (var cc in ccList)
mail.CC.Add(cc);
var client = new SmtpClient
{
Host = host,
UseDefaultCredentials = false,
Credentials = new System.Net.NetworkCredential(userName, password),
DeliveryMethod = SmtpDeliveryMethod.Network
};
try
{
client.Send(mail);
return true;
}
catch
{
return false;
}
}
开发者ID:EinsteinSu,项目名称:EsuCommon,代码行数:34,代码来源:EmailSender.cs
示例3: SendMailMessage
//function to send email. Returns true if successful, returns false if unsuccessful
public static bool SendMailMessage(string from, string recipient, string bcc, string cc, string subject, string body, bool isHTML, MailPriority priority)
{
try
{
MailMessage msg = new MailMessage();
msg.From = new MailAddress(from); //set from address
string[] arrRecipients = recipient.Split(';'); //add recipients to "TO" field
foreach (object x in arrRecipients) { msg.To.Add(new MailAddress(x.ToString())); }
if (bcc != "" && bcc != null) { msg.Bcc.Add(new MailAddress(bcc)); } //set bcc field
if (cc != "" && cc != null) { msg.CC.Add(new MailAddress(cc)); } //set cc field
msg.Subject = subject; //set subject field
if (isHTML == false) { msg.IsBodyHtml = false; } //set HTML option depending on param
else { msg.IsBodyHtml = true; }
msg.Body = body; //set body
msg.Priority = priority; //set message priority
SmtpClient client = new SmtpClient(); //new SMTP client - settings in web.config
client.Send(msg); //send message
}
catch {return false; }
return true;
}
开发者ID:CAI-IT,项目名称:Website,代码行数:27,代码来源:mail.cs
示例4: SendBulkEmail
public SendBulkEmail( ArrayList recipients, string priority, string format, string portalAlias )
{
this.Recipients = recipients;
switch( priority )
{
case "1":
this.Priority = MailPriority.High;
break;
case "2":
this.Priority = MailPriority.Normal;
break;
case "3":
this.Priority = MailPriority.Low;
break;
}
if( format == "BASIC" )
{
this.BodyFormat = MailFormat.Text;
}
else
{
this.BodyFormat = MailFormat.Html;
// Add Base Href for any images inserted in to the email.
this.Body = "<Base Href='" + portalAlias + "'>";
}
}
开发者ID:huayang912,项目名称:cs-dotnetnuke,代码行数:29,代码来源:SendBulkEmail.cs
示例5: SendEmail
/// <summary>
/// 结合配置文件改的
/// </summary>
/// <param name="mail"></param>
public static bool SendEmail(string from, string displayName, string to0, string subject, string body, string encoding, MailPriority prioity)
{
if (string.IsNullOrEmpty(displayName))
displayName = from;
MailAddress _from = new MailAddress(from, displayName);
MailAddress _to = new MailAddress(to0);
MailMessage mail = new MailMessage(_from, _to);
mail.Subject = subject;
mail.Body = body;
mail.BodyEncoding = System.Text.Encoding.Default;
if (!string.IsNullOrEmpty(encoding))
{
mail.BodyEncoding = System.Text.Encoding.GetEncoding(encoding);
}
mail.IsBodyHtml = true;
mail.Priority = prioity;
Configs.Config cfg = new Configs.Config();
// Override To
if (!string.IsNullOrEmpty(cfg.Email.MailTo_Override))
{
var tos = cfg.Email.MailTo_Override.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
mail.To.Clear();
foreach (var to in tos)
{
mail.To.Add(to);
}
}
return SendEmail(mail);
}
开发者ID:popotans,项目名称:hjnlib,代码行数:35,代码来源:EmailUtil.cs
示例6: Delivery
/// <summary>
/// Automatically sends email to Report Error Email. CC and BCC are allowed.
/// </summary>
/// <param name="subject">Email Subject.</param>
/// <param name="message">Email Message. It can be HTML.</param>
/// <param name="priority"> Mail Priority Normal | Low | High</param>
/// <param name="isHtml">Automatically set as TRUE, change to False for a non html message.</param>
/// <param name="CC"></param>
/// <param name="BCC"></param>
/// <returns></returns>
public static bool Delivery(string subject, string message, MailPriority priority, bool isHtml = true, string[] CC = null, string[] BCC = null)
{
MailMessage mail = new MailMessage();
SmtpClient smtp = new SmtpClient(ConfigurationManager.AppSettings["smtpServer"]);
try
{
mail.To.Add(ConfigurationManager.AppSettings["ReportErrorsEmail"]);
mail.From = new MailAddress(ConfigurationManager.AppSettings["NoReplyEmail"]);
mail.Priority = priority;
mail.IsBodyHtml = isHtml;
mail.Subject = subject;
mail.Body = message;
if (CC != null)
foreach (var item in CC)
mail.CC.Add(item);
if (BCC != null)
foreach (var item in BCC)
mail.Bcc.Add(item);
smtp.Credentials = new System.Net.NetworkCredential(ConfigurationManager.AppSettings["smtpUsrEmail"], ConfigurationManager.AppSettings["smtpPwd"]);
// Use port as necessary.
smtp.Port = 587;
smtp.Send(mail);
return true;
}
catch (Exception ex)
{
return false;
}
}
开发者ID:TricellSoftware,项目名称:Yodlee,代码行数:45,代码来源:Postman.cs
示例7: InviaEmailAsync
/// <summary>
///
/// </summary>
/// <param name="smtpClient"></param>
/// <param name="MailFrom_Address"></param>
/// <param name="MailTo_Address"></param>
/// <param name="Subject"></param>
/// <param name="Body"></param>
/// <param name="IsBodyEncoded"></param>
/// <param name="IsBodyHtml"></param>
/// <param name="Priority"></param>
/// <param name="Attachments">DisposableList<Attachment></param>
/// <returns></returns>
public static async Task InviaEmailAsync(SmtpClient smtpClient,
MailAddress MailFrom_Address, string MailsTo,
string Subject, string Body,
bool IsBodyEncoded = false,
bool IsBodyHtml = false,
MailPriority Priority = MailPriority.Normal,
List<Attachment> Attachments = null)
{
using (MailMessage mailMsg = new MailMessage())
{
mailMsg.From = MailFrom_Address;
mailMsg.To.Add(MailsTo);
mailMsg.Subject = Subject;
string body = Body;
if (IsBodyEncoded)
body = System.Net.WebUtility.HtmlDecode(body);
mailMsg.Body = body;
mailMsg.IsBodyHtml = IsBodyHtml;
mailMsg.Priority = Priority;
//allegati
if (Attachments != null && Attachments.Count > 0)
foreach (var attach in Attachments)
mailMsg.Attachments.Add(attach);
await smtpClient.SendMailAsync(mailMsg).ConfigureAwait(false);
}
}
开发者ID:Simone000,项目名称:Utils,代码行数:42,代码来源:EmailManager.cs
示例8: Message
public Message(string subject, string recipientAddress,
string htmlBody, string plainTextBody,
string senderAddress = "", string senderName = "",
MailPriority priority = MailPriority.Normal,
string copyAddress = "", string blindCopyAddress = "")
{
if(string.IsNullOrEmpty(subject))
throw new ArgumentOutOfRangeException("subject", "The 'subject' parameter can not be null or empty");
if(string.IsNullOrEmpty(recipientAddress))
throw new ArgumentOutOfRangeException("recipientAddress", "The 'recipientAddress' parameter can not be null or empty");
if(string.IsNullOrEmpty(htmlBody))
throw new ArgumentOutOfRangeException("htmlBody", "The 'htmlBody' parameter can not be null or empty");
if(string.IsNullOrEmpty(plainTextBody))
throw new ArgumentOutOfRangeException("plainTextBody", "The 'plainTextBody' parameter can not be null or empty");
this._Subject = subject;
this._RecipientAddress = recipientAddress;
if(senderAddress != "") this._Sender = new MailAddress(senderAddress, senderName);
this._HtmlBody = htmlBody;
this._PlainTextBody = plainTextBody;
this._Priority = priority;
this._CopyAddress = copyAddress;
this._BlindCopyAddress = blindCopyAddress;
}
开发者ID:findel,项目名称:Wubblog,代码行数:27,代码来源:Message.cs
示例9: SetBasicInfos
private static MailMessage SetBasicInfos(string MessageFrom, string MessageTo, string MessageCc, string MessageBcc, string MessageSubject, MailPriority MessagePriority, string MessageText)
{
char[] delim = { ',', ';', ' ', ':', '\\', '|' };
StringSplitOptions opt = StringSplitOptions.RemoveEmptyEntries;
MailMessage myMail = new MailMessage();
myMail.From = new MailAddress(MessageFrom);
myMail.To.AddList(MessageTo.Split(delim, opt).Encapsulate<string, MailAddress>());
if (!String.IsNullOrEmpty(MessageCc))
myMail.CC.AddList<MailAddress>(
MessageCc.Split(delim, opt)
.Encapsulate<string, MailAddress>()
);
if (!String.IsNullOrEmpty(MessageBcc))
myMail.Bcc.AddList<MailAddress>(
MessageCc.Split(delim, opt)
.Encapsulate<string, MailAddress>()
);
myMail.Subject = MessageSubject;
myMail.Priority = MessagePriority;
myMail.BodyEncoding = Encoding.UTF8;
myMail.Body = MessageText;
return myMail;
}
开发者ID:kLeZ,项目名称:Gecko,代码行数:27,代码来源:Mail.cs
示例10: SendTemplateMail
/// <summary>
/// Sends the template mail.
/// </summary>
/// <param name="mailSettings">STMP email settings</param>
/// <param name="fromAddress">From address.</param>
/// <param name="fromDisplayName">From display name.</param>
/// <param name="toAddress">To address.</param>
/// <param name="toName">To display name.</param>
/// <param name="ccAddressesCSV">Optional CC addresses (CSV).</param>
/// <param name="bccAddressesCSV">Optional BCC addresses CSV.</param>
/// <param name="subject">The subject.</param>
/// <param name="templateFilePath">The template file path.</param>
/// <param name="replacements">The replacements.</param>
/// <param name="appRootFolder">'/' if site is running in the base folder, or '/foldername/' if site is running in a sub-folder.</param>
/// <param name="templateVirtualFolder">The template virtual folder.</param>
/// <param name="wrapperTemplateFilePath">Optional wrapper template file path.</param>
/// <param name="isBodyHtml">Set to true if the body of the email is HTML; false otherwise.</param>
public static void SendTemplateMail(MailSettings mailSettings, string toAddress, string toName,
string ccAddressesCSV, string bccAddressesCSV, string subject, string templateFilePath,
ListDictionary replacements, string templateVirtualFolder, string appRootFolder, string wrapperTemplateFilePath = null, bool isBodyHtml = true, MailPriority priority = MailPriority.Normal,
string attachmentDosPaths = null)
{
if (File.Exists(templateFilePath))
{
StringBuilder messageText = null;
string templateText = null;
if (File.Exists(templateFilePath))
{
templateText = File.ReadAllText(templateFilePath);
}
else
{
throw new Exception("Cannot find template " + templateFilePath);
}
if (!string.IsNullOrEmpty(wrapperTemplateFilePath) && File.Exists(wrapperTemplateFilePath))
{
string str = File.ReadAllText(wrapperTemplateFilePath).Replace("@@WrapperContents", templateText);
messageText = new StringBuilder(str);
}
else
{
messageText = new StringBuilder(templateText);
}
// Add some mandatory fields to the replacements
if (replacements == null)
{
// Ensure not null.
replacements = new ListDictionary();
}
replacements.Add("@@HttpRoot", string.Format("http://{0}/", mailSettings.Host));
replacements.Add("@@TemplateFolder", string.Format("http://{0}{1}{2}", mailSettings.Host, appRootFolder, templateVirtualFolder.Trim("~/".ToCharArray())));
SendMail(
mailSettings,
toAddress,
toName,
ccAddressesCSV,
bccAddressesCSV,
subject,
messageText.ToString(),
true,
attachmentDosPaths,
priority,
replacements);
}
else
{
//Every1.Core.Web.Utils.TraceWarn("SendTemplateMail", "templateFilePath " + templateFilePath + " does not exist");
}
}
开发者ID:antmx,项目名称:Summerland,代码行数:74,代码来源:Mailer.cs
示例11: Email
/// <summary>
/// Sends and email
/// </summary>
/// <param name="to">Message to address</param>
/// <param name="body">Text of message to send</param>
/// <param name="subject">Subject line of message</param>
/// <param name="fromAddress">Message from address</param>
/// <param name="fromDisplay">Display name for "message from address"</param>
/// <param name="credentialUser">User whose credentials are used for message send</param>
/// <param name="credentialPassword">User password used for message send</param>
/// <param name="attachments">Optional attachments for message</param>
public static void Email(string mailServerAddress,
string toAddress,
string body,
string subject,
string fromAddress,
string fromDisplay,
string credentialUser,
string credentialPassword,
MailAttachment[] attachments,
string linkConfirm = null,
string passPlainText = null,
MailType mailType = MailType.Normal,
MailPriority mailpriority = MailPriority.Normal)
{
string host = mailServerAddress;
body = UpgradeEmailFormat(body, linkConfirm, passPlainText, mailType);
try
{
MailMessage mail = new MailMessage() { Body = body, IsBodyHtml = true };
string[] toArray = toAddress.Split(';');
foreach (string to in toArray)
{
mail.To.Add(new MailAddress(to.Trim()));
}
mail.From = new MailAddress(fromAddress, fromDisplay, Encoding.UTF8);
mail.Subject = subject;
mail.SubjectEncoding = Encoding.UTF8;
mail.Priority = mailpriority;
using (SmtpClient smtp = new SmtpClient())
{
// This is necessary for gmail
//smtp.EnableSsl = true;
//smtp.Credentials = new System.Net.NetworkCredential(credentialUser, credentialPassword);
smtp.Host = host;
smtp.Send(mail);
}
}
catch
{
StringBuilder sb = new StringBuilder(1024);
sb.Append("\\nTo:" + toAddress);
sb.Append("\\nbody:" + body);
sb.Append("\\nsubject:" + subject);
sb.Append("\\nfromAddress:" + fromAddress);
sb.Append("\\nfromDisplay:" + fromDisplay);
sb.Append("\\ncredentialUser:" + credentialUser);
sb.Append("\\ncredentialPasswordto:" + credentialPassword);
sb.Append("\\nHosting:" + host);
Debug.Print(sb.ToString());
}
}
开发者ID:thientt,项目名称:FASTrack,代码行数:68,代码来源:SmtpMailSender.cs
示例12: SendEmail
public Boolean SendEmail(String toAddress, String addresseName, String from, String senderName, String subject, String msgBody, MailPriority msgPriority)
{
try
{
return SendEmail(toAddress, addresseName, String.Empty, String.Empty, from, senderName, subject, msgBody, true, msgPriority);
}
catch
{
return false;
}
}
开发者ID:akhtarali1122,项目名称:Bakhshu,代码行数:11,代码来源:EmailManager.cs
示例13: SendEmailByCredential
public static bool SendEmailByCredential(string host, MailPriority priority, string user_name, string password, string[] mailto, string[] cc, string[] bcc, string subject, string body, bool is_body_html, string[] attachments, bool enableSSL, System.Collections.Specialized.NameValueCollection messageHeaders, string reply_to)
{
SmtpClient mail = new SmtpClient();
mail.DeliveryMethod = SmtpDeliveryMethod.Network;
mail.Host = host;// "smtp.163.com";
mail.UseDefaultCredentials = false;
mail.Credentials = new System.Net.NetworkCredential(user_name, password);
mail.EnableSsl = enableSSL;
MailMessage message = new MailMessage();
if (messageHeaders != null && messageHeaders.Count > 0)
{
message.Headers.Add(messageHeaders);
}
message.From = new MailAddress(user_name + "@" + host.Substring(host.IndexOf(".") + 1));
if (mailto != null)
{
foreach (string s in mailto)
{
if (!string.IsNullOrEmpty(s))
message.To.Add(s);
}
}
if (cc != null)
{
foreach (string s in cc)
{
if (!string.IsNullOrEmpty(s))
message.CC.Add(s);
}
}
if (bcc != null)
{
foreach (string s in bcc)
{
if (!string.IsNullOrEmpty(s))
message.Bcc.Add(s);
}
}
if (!string.IsNullOrEmpty(reply_to)) message.ReplyTo = new MailAddress(reply_to);
message.Subject = subject;
message.Body = body;
message.BodyEncoding = System.Text.Encoding.UTF8;
message.IsBodyHtml = is_body_html;
message.Priority = priority;
if (attachments != null)
{
foreach (string s in attachments)
{
message.Attachments.Add(new Attachment(s));
}
}
mail.Send(message);
return true;
}
开发者ID:TaylorLi,项目名称:WorkStudioEnhance,代码行数:54,代码来源:EmailHelper.cs
示例14: SendEmail
public void SendEmail(string subject, string body, string mailTo, string replayTo, MailPriority mailPriority)
{
//SendMailExchange(mailTo, subject, body, replayTo);
string SMTPEmailHost = systemMgr.GetEntityPreferenceValue(Entity.SYS.EntityPreference.CodeEnum.SMTPEmailHost);
string SMTPEmailPasswd = systemMgr.GetEntityPreferenceValue(Entity.SYS.EntityPreference.CodeEnum.SMTPEmailPasswd);
string emailFrom = systemMgr.GetEntityPreferenceValue(Entity.SYS.EntityPreference.CodeEnum.SMTPEmailAddr);
SMTPHelper.SendSMTPEMail(subject, body, emailFrom, mailTo, SMTPEmailHost, SMTPEmailPasswd, (!string.IsNullOrWhiteSpace(replayTo) ? replayTo : emailFrom), mailPriority);
}
开发者ID:druidwang,项目名称:Les_parts,代码行数:11,代码来源:EmailMgrImpl.cs
示例15: Send
public static async Task Send(string to, string body, string subject, bool? isHtml = null, MailPriority priority = MailPriority.Normal)
{
MailMessage email = new MailMessage(new MailAddress(ConfigurationManager.AppSettings["EmailFrom"]), new MailAddress(to));
email.Subject = subject;
email.Body = body;
email.BodyEncoding = System.Text.Encoding.Default;
email.Priority = priority;
email.IsBodyHtml = (isHtml.HasValue ? isHtml.Value : true);
await smtpClient.SendMailAsync(email);
}
开发者ID:innercitypressure,项目名称:ngKeyBase,代码行数:12,代码来源:MailService.cs
示例16: SendMail
/// <summary>
/// Invia un messaggio di posta elettronica
/// </summary>
/// <param name="MessageFrom">Mittente</param>
/// <param name="MessageTo">Destinatario o destinatari</param>
/// <param name="MessageCc">Destinatario o destinatari in copia conoscenza</param>
/// <param name="MessageBcc">Destinatario o destinatari in copia conoscenza nascosta</param>
/// <param name="MessageSubject">Soggetto del messaggio</param>
/// <param name="MessagePriority">Priorità del messaggio</param>
/// <param name="MessageText">Testo del messaggio</param>
/// <param name="ServerName">Server di email</param>
public static void SendMail(string MessageFrom, string MessageTo, string MessageCc, string MessageBcc, string MessageSubject, MailPriority MessagePriority, string MessageText, string ServerName, bool EnableSsl, NetworkCredential authentication)
{
MailMessage myMail = SetBasicInfos(MessageFrom, MessageTo, MessageCc, MessageBcc, MessageSubject, MessagePriority, MessageText);
SmtpClient mySmtpC = null;
if (ServerName != null)
mySmtpC = new SmtpClient(ServerName);
else
mySmtpC = new SmtpClient();
mySmtpC.EnableSsl = EnableSsl;
if (authentication != null)
mySmtpC.Credentials = authentication;
mySmtpC.Send(myMail);
}
开发者ID:kLeZ,项目名称:Gecko,代码行数:25,代码来源:Mail.cs
示例17: Send
public void Send(MessageRoutingSystemError message, bool isPool = false, MailPriority priority = MailPriority.Normal)
{
try
{
var body = GenerateHtml(message, isPool);
using (var mailMessage = new MailMessage())
{
mailMessage.From = new MailAddress(FromAddress);
// Add recipients
if (!string.IsNullOrWhiteSpace(ToAddress))
{
ToAddress.Split(';').ToList().ForEach(x => mailMessage.To.Add(x));
}
else
{
var defaultDelivery = ConfigurationManager.AppSettings["DefaultDelivery"];
defaultDelivery.Split(';').ToList().ForEach(x => mailMessage.To.Add(x));
}
mailMessage.Priority = priority;
mailMessage.Body = body;
mailMessage.IsBodyHtml = true;
mailMessage.Subject = string.IsNullOrWhiteSpace(Subject) ? $"Error Occurred in Application '{message.ApplicationName}'" : Subject;
var smtpClient = new SmtpClient()
{
Host = Host,
Port = Port,
UseDefaultCredentials = false,
EnableSsl = true
};
var networkCredentials = new NetworkCredential
{
UserName = Username,
Password = Password
};
smtpClient.Credentials = networkCredentials;
smtpClient.Send(mailMessage);
}
}
catch (Exception e)
{
}
}
开发者ID:adback03,项目名称:MessageRoutingSystem,代码行数:49,代码来源:EmailClient.cs
示例18: SendEmailAsync
public Task SendEmailAsync(string toAddress, string subject, string message, MailPriority priority = MailPriority.Normal)
{
var mail = new MailMessage(ConfigurationManager.AppSettings["EmailFromAddress"], toAddress);
var client = new SmtpClient();
client.Port = 25;
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.UseDefaultCredentials = false;
client.Host = ConfigurationManager.AppSettings["EmailHost"];
mail.IsBodyHtml = true;
mail.Subject = subject;
mail.Body = message;
mail.Priority = priority;
client.SendAsync(mail, null);
return Task.FromResult(0);
}
开发者ID:gregcummines,项目名称:XanoServiceNotificationCenter,代码行数:15,代码来源:MailService.cs
示例19: SendEmail
public void SendEmail(string subject, string body, string mailTo, string replayTo, MailPriority mailPriority)
{
//string SMTPEmailHost = systemMgr.GetEntityPreferenceValue(EntityPreference.CodeEnum.SMTPEmailHost);
//string SMTPEmailPasswd = systemMgr.GetEntityPreferenceValue(EntityPreference.CodeEnum.SMTPEmailPasswd);
//string emailFrom = systemMgr.GetEntityPreferenceValue(EntityPreference.CodeEnum.SMTPEmailAddr);
string SendMailServiceAddress = systemMgr.GetEntityPreferenceValue(com.Sconit.Entity.SYS.EntityPreference.CodeEnum.SendMailServiceAddress);
string SendMailServicePort = systemMgr.GetEntityPreferenceValue(com.Sconit.Entity.SYS.EntityPreference.CodeEnum.SendMailServicePort);
SendMail.SendMailV2 sendMailv2 = new SendMail.SendMailV2();
sendMailv2.Url = ServiceURLHelper.ReplaceServiceUrl(sendMailv2.Url, SendMailServiceAddress, SendMailServicePort);
SendMail.SecurityHeader securityHeader = new SendMail.SecurityHeader();
securityHeader.UserName = userName;
securityHeader.UserPassword = userPassword;
sendMailv2.SecurityHeaderValue = securityHeader;
sendMailv2.SendEmailAndUpAttachments(mailTo, string.Empty, subject, body, new UpAttachments[] { }, isOneByOne, senderNo);
//SMTPHelper.SendSMTPEMail(subject, body, emailFrom, mailTo, SMTPEmailHost, SMTPEmailPasswd, (!string.IsNullOrWhiteSpace(replayTo) ? replayTo : emailFrom), mailPriority);
}
开发者ID:Novthirteen,项目名称:sih-les,代码行数:16,代码来源:EmailMgrImpl.cs
示例20: SendMail
/// <summary>
/// 发送邮件
/// </summary>
public void SendMail(string to, string cc, string subject, string body, MailPriority priority, params Guid[] files)
{
using (TranscationHelper trans = TranscationHelper.GetInstance())
{
trans.BeginTrans();
try
{
SendMail(trans, to, cc, subject, body, priority, files);
trans.CommitTrans();
}
catch
{
trans.RollTrans();
throw;
}
}
}
开发者ID:niceplayer454,项目名称:cfi,代码行数:21,代码来源:MailBl.cs
注:本文中的MailPriority类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论