Ошибка при отправке почты с использованием приложения Windows - PullRequest
0 голосов
/ 14 апреля 2020

В моей системе я использую windows проект приложения. При отправке письма из проекта я получаю сообщение об ошибке "Создание экземпляра компонента COM с CLSID {20C62CA0-15DA-101B-B9A8-444553540000} из IClassFactory завершилось неудачно из-за следующей ошибки: 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

enter image description here

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...