加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

vb邮件功能测试

发布时间:2020-12-16 22:16:24 所属栏目:大数据 来源:网络整理
导读:VERSION 5.00Object = "{20C62CAE-15DA-101B-B9A8-444553540000}#1.1#0"; "MSMAPI32.OCX"Begin VB.Form Form1 BorderStyle = 1 'Fixed Single Caption = "Form1" ClientHeight = 6405 ClientLeft = 45 ClientTop = 330 ClientWidth = 8745 LinkTopic = "Form
VERSION 5.00
Object = "{20C62CAE-15DA-101B-B9A8-444553540000}#1.1#0"; "MSMAPI32.OCX"
Begin VB.Form Form1 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Form1"
   ClientHeight    =   6405
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   8745
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   6405
   ScaleWidth      =   8745
   StartUpPosition =   2  '屏幕中心
   Begin VB.ListBox List1 
      Height          =   6180
      Left            =   0
      TabIndex        =   2
      Top             =   0
      Width           =   7215
   End
   Begin VB.CommandButton Command2 
      Caption         =   "RECEVIED"
      Height          =   495
      Left            =   7320
      TabIndex        =   1
      Top             =   720
      Width           =   1215
   End
   Begin VB.CommandButton Command1 
      Caption         =   "SEND"
      Height          =   495
      Left            =   7320
      TabIndex        =   0
      Top             =   0
      Width           =   1215
   End
   Begin MSMAPI.MAPIMessages MAPIMessages1 
      Left            =   7800
      Top             =   2040
      _ExtentX        =   1005
      _ExtentY        =   1005
      _Version        =   393216
      AddressEditFieldCount=   1
      AddressModifiable=   0   'False
      AddressResolveUI=   0   'False
      FetchSorted     =   0   'False
      FetchUnreadOnly =   0   'False
   End
   Begin MSMAPI.MAPISession MAPISession1 
      Left            =   7800
      Top             =   1320
      _ExtentX        =   1005
      _ExtentY        =   1005
      _Version        =   393216
      DownloadMail    =   0   'False
      LogonUI         =   -1  'True
      NewSession      =   0   'False
      Password        =   "123456"
      UserName        =   "jeijing.gu"
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
'发送邮件
'    Me.MAPISession1.SignOn
    With Me.MAPIMessages1
        .MsgIndex = -1
        .RecipDisplayName = "jeijing.gu@10.33.52.173"
        .MsgSubject = "abcdefg"
        .MsgNoteText = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
        .SessionID = Me.MAPISession1.SessionID
        .Send
    End With
End Sub

Private Sub Command2_Click()
'接受邮件
    Dim i1 As Integer
'    Me.MAPISession1.SignOn
    Me.MAPIMessages1.SessionID = Me.MAPISession1.SessionID
    Me.MAPIMessages1.FetchSorted = True
    Me.MAPIMessages1.FetchUnreadOnly = True
    Me.MAPIMessages1.Action = 1
    Debug.Print Me.MAPIMessages1.MsgCount
    Me.List1.Clear
    For i1 = 0 To Me.MAPIMessages1.MsgCount - 1
        Me.MAPIMessages1.MsgIndex = i1
        Me.List1.AddItem Me.MAPIMessages1.MsgSubject
    Next i1

End Sub

Private Sub Form_Load()
'
    Me.MAPISession1.SignOn
'    Me.MAPIMessages1.SessionID = Me.MAPISession1.SessionID
'    Me.MAPISession1.SignOn
End Sub

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读