2017-03-17 28 views
2

基本的に電子メールを送受信するサービスを含むVB6アプリケーションを作成しました。サービスはWindows 2003 serverR2で構成されたサービスアカウントとmapiプロファイルを使用します。VB6アプリケーションとMAPIの接続

交換サーバーとドメインアカウントの両方が同じネットワーク内にある場合にこれが機能していました。交換サーバーが変更されると、サービスはエラーを送信または受信できません

Microsoft Exchangeは利用できません。ネットワークに問題があるか、Exchangeコンピュータがメンテナンスのために停止しています。 [Microsoft Exchange Information Store - [MAPI_E_FAILONEPROVIDER(8004011D)]]、コラボレーションデータオブジェクト。

私はこのエラーを検索しましたが、説明は同じネットワークのため、すべて収集できませんでした。 これを解決するにはどうすればよいですか? ありがとう、

+0

MAPI/CDOは、最近のバージョンのExchangeのAPIとして廃止されました。 https://technet.microsoft.com/en-us/library/jj619283(v=exchg.160).aspxを参照してください。 – Bob77

答えて

0

MAPIは、@ bob77によって提案されたようにMicrosiftによって廃止されました。 SMTPまたはEWSの使用をお勧めします。

あなたはまだそれと一緒に行きたいと言われています。 以下の作業コードを見つけてください:

Set objMAPI = New MAPI.Session 
    objMAPI.Logon ShowDialog:=False, NewSession:=False, ProfileInfo:=gobjINI.gstrExchangeServer & vbLf & gobjINI.gstrProfile 

'Add a new mesage to the OUtbo Messages Collection 
Set objMSG = objMAPI.Outbox.Messages.Add 

Set fsoMy_File_Sys_Obj = New FileSystemObject 

'Add the recipient list specified in INI File 
'Check if this is a multiple Recipient List (names or groups seperated by semicolons!) 
If InStr(1, Recipients, ";") Then 
    objMSG.Recipients.AddMultiple Recipients, CdoTo 
    objMSG.Recipients.Resolve 
Else 
    'This section is for handling of single recipient name 
    'Be aware that this may be an email group list name ! 
    Set objRecipients = objMSG.Recipients.Add(Recipients) 
    objRecipients.Resolve 
End If 

'Add an attachment if needed 
If Attachment_Name <> "" Then 
    bolAttach_File_Exists = fsoMy_File_Sys_Obj.FileExists(Attachment_Path) 
    If bolAttach_File_Exists = True Then 
     'Open the attachment file and add it to the message text 
     Set tsAttachment = fsoMy_File_Sys_Obj.OpenTextFile(Attachment_Path) 
     Do While Not tsAttachment.AtEndOfStream 
      strAttachment_Read = tsAttachment.ReadLine 
      Message = Message & strAttachment_Read & vbCrLf 
     Loop 
     tsAttachment.Close 
    Else 
     gobjMAPI.MailSend gobjINI.gstrMailRecipients, "Email Send - Attachment Addition", "Attempted To Attach A File That Does Not Exist", "", "" 
    End If 
End If 

'Add Subject Line, Message Content and Send Message 
objMSG.Subject = Subject 
objMSG.Text = Message 
objMSG.Importance = mapiHigh 

'The Update method adds all our assignments to collecttion 
objMSG.Update 

'Now let's actually send the message 
objMSG.Send 

'End MAPI Session 
objMAPI.Logoff 
Set objMAPI = Nothing 
関連する問題