windows - 使用 Windows 应用程序发送邮件时出错
问题描述
在我的系统中,我使用的是 Windows 应用程序项目。当我从项目发送邮件时,我收到一个错误,因为“从 IClassFactory 创建具有 CLSID {20C62CA0-15DA-101B-B9A8-444553540000} 的 COM 组件实例失败,因为以下错误:80040112 类不是许可使用(来自 HRResult 的例外:0x800401120)。” . 你能帮我解决这个问题吗?我正在使用 Windows 10 操作系统。
Dim oMAPSession As New MSMAPI.MAPISession <br/>
Dim MAPIMessages As New MSMAPI.MAPIMessages
Do While J > 0
With MAPIMessages
oMAPSession.SignOn()
.SessionID = oMAPSession.SessionID
.Compose()
If attachbio Then
.AttachmentIndex = 0
If CustomTable.GetCustomNumber("TEPrintPerUser") = 1 Then
.AttachmentPathName = g_fpReportsPath & "\tempbio.pdf"
Else
.AttachmentPathName = Application.StartupPath & "\tempbio.pdf"
End If
.AttachmentName = "techbio.pdf"
End If
strRecip = Trim(rdtxtFldNumber.Text)
i = 0
Do
.RecipIndex = i
.RecipType = 1
If InStr(1, strRecip, ";") > 0 Then
.RecipDisplayName = Microsoft.VisualBasic.Left(strRecip, InStr(1, strRecip, ";") - 1)
strRecip = Mid(strRecip, InStr(1, strRecip, ";") + 1)
i = i + 1
Else
If (strRecip <> "") Then
.RecipDisplayName = strRecip
End If
Exit Do
End If
Loop
GetDispatchForm = New FrmDispatch
If g_sidCustomization = "Nebrasky" And GetDispatchForm.rdddlText.SelectedIndex = 1 Then
.MsgSubject = Replace(rdtxtfpSubject.Text, Chr(10), " ")
Else
.MsgSubject = "Text Message " & Date.Now
End If
If tmpTextCapacity <= 0 Or (Not IsNumeric(Microsoft.VisualBasic.Left(.RecipDisplayName, InStr(1, .RecipDisplayName, "@") - 1))) Then
.MsgNoteText = strText
J = 0
Else
.MsgNoteText = Microsoft.VisualBasic.Left(strText, tmpTextCapacity)
End If
.Send()
End With
strText = Mid(strText, tmpTextCapacity + 1)
J = J - tmpTextCapacity
Loop
解决方案
推荐阅读
- javascript - 无法将mysql结果存储在外部变量中
- php - 在 PHP 中验证字母数字字符串
- reactjs - 在 React 中,为什么我不能使用嵌套的箭头函数……虽然正常的函数似乎可以工作?
- r - 在 R 中使用 plot() 并在我想要点时获得连接点的线
- java - 带有 Lucene Highlighter 和同义词列表的 Hibernate Search 6
- python - 基于元素递归创建目录(Web-Scraping using Selenium / BS4)
- amazon-web-services - 用于删除特定 aws 资源的工具
- python - 试图找出一个数字中有多少位是另一个数字的倍数
- python - 如何计算循环中不同拆分的基尼系数?
- excel - VBA 代码故障:应用程序。ScreenUpdating = False 在一个按钮下调用 subs 时不起作用