画面にMAPISessionとMAPIMessagesを貼り付けて。。。
-----------------------
Me.AxMAPISession1.SignOn()
'セッションの関連付け
Me.AxMAPIMessages1.SessionID = Me.AxMAPISession1.SessionID
With Me.AxMAPIMessages1
'メッセージを作成
.Compose()
'あて先
.RecipDisplayName = "[DisplayName]"
'メールアドレス
.RecipAddress = "[mailaddress]"
'Subject
.MsgSubject = "サブジェクト"
'本文
.MsgNoteText = "本文"
'添付ファイル(複数)
For i As Int32 = 0 To filelist.Count - 1
.AttachmentIndex = i
.AttachmentPathName = DirectCast(filelist.Item(i), FileInfo).FullName
.AttachmentName = "Flie" & (i + 1).ToString
'コレが重要。スペースが必要。
'NOTE .MsgNoteText = " " -> KB173853 in microsoft
.MsgNoteText = " "
Next
Try
.Send(True)
Catch ex As System.Runtime.InteropServices.COMException
Debug.WriteLine("メール送信時のキャンセルでComExceptionが発生っぽい")
Debug.WriteLine(ex)
End Try
End With
Me.AxMAPISession1.SignOff()
0 件のコメント:
コメントを投稿