在 VBA 中,我目前使用类似于以下的代码来创建和发送 Outlook 邮件项目:
Function example()
Dim OutAppl As Outlook.Application
Dim my_email As Outlook.MailItem
Set OutAppl = New Outlook.Application
Set my_email = OutAppl.CreateItem(olMailItem)
With my_email
.Importance = 2
.To = "me@foo.com; "
.Subject = "not so easy in C#"
.BodyFormat = 2 'olFormatHTML
.HTMLBody = "<P>" & _
"<BR>" & _
"<FONT face=""Lucida Sans Unicode"" size=2.5>" & _
"Hello SO" & _
"<BR>" & _
"</FONT>" & _
"</P>" & _
"</BODY></HTML>"
.Save
.send
End With
Set OutAppl = Nothing
Set my_email = Nothing
End Function
我从哪里开始使用 C# 创建类似上面的东西?我可以参考类似于使用 excel 的 Outlook interops assemply 吗?