我们正在考虑使用Office365 API发送电子邮件。我们考虑Office365的一个原因是能够自动应用签名。因此,如果我们为特定用户发送自动电子邮件,我们是否能够指定要将签名附加到该电子邮件中?
我们是否需要为我们发送的用户使用用户凭据,或者是否有管理员角色允许我们选择/自动应用正确的电子邮件签名?
谢谢,
发布于 2016-04-19 01:23:11
在使用O365 API向特定用户发送电子邮件时,不能选择/应用不同的签名。作为解决办法,使用outlook邮件rest,您可以创建电子邮件消息,在发送给特定用户时将电子邮件签名插入到电子邮件正文的末尾。您可以使用HTML正文作为电子邮件消息,例如:
// Create the email message text body.
string htmlBodyTxt = @"<html><head></head><body><p>This is the email message body before a signature is added.</p>
</body></html>";
// Identify the signature insertion point at the end of the HTML body.
int signatureInsertPnt = htmlBodyTxt.IndexOf("</body>");
// Create the email signature.
string signature = "<p>Dallas Durkin<br/>Senior Planner<br/>Adventure Works Cycles</p>" +
"<p>4567 Main St.<br/>La Habra Heights, CA 90631</p><p>(323) 555-0100</p>";
// Insert the signature into the HTML body.
string newBody = htmlBodyTxt.Insert(signatureInsertPnt, signature);https://stackoverflow.com/questions/36626903
复制相似问题