Outlook HTMLBody拒绝输出我指定的字体大小,无论值如何

问题描述 投票:2回答:1

我有此代码可发送电子邮件抛出展望

Microsoft.Office.Interop.Outlook.Application oApp = new Microsoft.Office.Interop.Outlook.Application(); 
Microsoft.Office.Interop.Outlook.MailItem oMsg = (Microsoft.Office.Interop.Outlook.MailItem)oApp.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem); 
oMsg.To = "[email protected]"; oMsg.CC = "[email protected]"; oMsg.Subject = "Fiche De Non-Confoemité N°: " + txtOrderNumber.Text+"/"+ txtCreationDate.DateTime.Year; 
oMsg.BodyFormat = Microsoft.Office.Interop.Outlook.OlBodyFormat.olFormatHTML; 
oMsg.Display(false); 
oMsg.HTMLBody = "<font size='18px'>"+"Un nouveau fiche de non-confoemité a été ajouté: "+ 
                "<br />" + "N°: " + txtOrderNumber.Text + "/" + txtCreationDate.DateTime.Year +
                "<br />" + "Détecteur: " + cmbDetecteurStructure.Text +
                "<br />" + "Personne Concernée: " + cmbRelevantEmployee.Text +
                "<br />" + "Date: " + txtCreationDate.Text +
                "<br />" + "Crée par « Smart Industrial Management »" +"</font>"+ oMsg.HTMLBody ;

我尝试使用不同的值(14,16,18,20),但是我总是在Outlook中获得相同的大小(10)。我该如何解决这个问题?]

c# html winforms outlook
1个回答
1
投票

将您的文本换成某个块,例如span,然后在其中添加style

<span style=\"font-size:16px\">Un nouveau fiche de non-confoemité a été ajouté:</span>

或仅将style应用于您的font标签:

<font style=\"font-size:16px\"> 
© www.soinside.com 2019 - 2024. All rights reserved.