使用服务器对象模型的电子邮件主题列表项值 [英] email subject list item value using server object model
本文介绍了使用服务器对象模型的电子邮件主题列表项值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我无法使用服务器对象模型在电子邮件触发器中为列表项值添加前缀.
I am unable to prefix the list item value in email trigger using server object model.
示例:
自定义列表
请求ID
20
电子邮件主题:20
请帮助将此值附加到我的电子邮件触发器的主题行中
please help to append this value in subject line of my email trigger
闪电战
推荐答案
请检查以下代码:
Please check the following code:
public static void SendEmail(
SPWeb spWeb,
string from,
string to,
string cc,
string bcc,
string subject,
string body,
string requestId)
{
string emailSummary;
var messageHeaders = new StringDictionary();
ValidationHelper.VerifyStringArgument(to, "to");
ValidationHelper.VerifyStringArgument(from, "from");
ValidationHelper.VerifyStringArgument(subject, "subject");
ValidationHelper.VerifyStringArgument(cc, "cc");
ValidationHelper.VerifyStringArgument(bcc, "bcc");
subject = "Email Subject : " + requestId
messageHeaders.Add("to", to);
messageHeaders.Add("from", from);
messageHeaders.Add("subject", subject);
messageHeaders.Add("cc", cc);
messageHeaders.Add("bcc", bcc);
string mimeType = "text/plain";
messageHeaders.Add("content-type", mimeType);
bool sendMail = SPUtility.SendEmail(
spWeb,
messageHeaders,
body);
}
取自 https://www .collaboris.com/code-sample-how-to以编程方式发送一封电子邮件-sharepoint/
这篇关于使用服务器对象模型的电子邮件主题列表项值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文