用api吧
先定义:
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
代码段:
ShellExecute hwnd, "open", "mailto:", vbNullString, vbNullString, 0

解决方案 »

  1.   

    Api?只是简单的发送是不行的,谢谢
    To 猫仔
    base64 Encode是怎么编码的?谢谢
      

  2.   

    S: 250-smtp.example.com 
    S: 250 AUTH CRAM-MD5 DIGEST-MD5 这中间是不是缺了一步?
      

  3.   

    S: 250-smtp.example.com 
    S: 250 AUTH CRAM-MD5 DIGEST-MD5 
    是不是缺了一步?
      

  4.   

    感谢您使用微软产品。您可以到微软的网站下载一个B64_samp.exe的工具来进行Base64的编码与解码。具体的信息您可以参考下面的文章:
    Q191239 Sample Base 64 Encoding and Decoding
    http://support.microsoft.com/support/kb/articles/q191/2/39.asp
    下载之后,您需要编译一下。您可以使用下面的命令:
    C: EHLO
    S: 250-smtp.example.com 
    S: 250 AUTH CRAM-MD5 DIGEST-MD5 
    C: AUTH login
    S: 334 VXNlcm5hbWU6 //Username:
    C: VGVzdA==          //Test
    S: 334 UGFzc3dvcmQ6 //Password:
    C: MTIzNDU=          //12345
    S: 2.7.0 Authentication successful.本帖子仅供CSDN的用户作为参考信息使用。其内容不具备任何法律保障。您需要考虑到并承担使用此信息可能带来的风险。具体事项可参见使用条款(http://support.microsoft.com/directory/worldwide/zh-cn/community/terms_chs.asp)。为了为您创建更好的讨论环境,请参加我们的用户满意度调查(http://support.microsoft.com/directory/worldwide/zh-cn/community/survey.asp?key=(S,49854782))。
      

  5.   

    非常感谢,这几步我都走过来了,真的谢谢;[我找到了Base64的编码方法]
    如果有人需要代码,请发信给[email protected]
      

  6.   

    验证要用 esmtp 命令
    把 smtp 中的 helo 命令换为 ehlo 命令.
    再用 auth 命令发送 经过base64 编码的 username 和 pwd 
    ======================================================
    用 Winsock 控件    dsSock.SendData "EHLO " & strFrom & vbCrLf
        dsSock.SendData "AUTH LOGIN " & vbCrLf
        dsSock.SendData Base64Encode(txtUser) & vbCrLf    
        dsSock.SendData Base64Encode(txtPwd) & vbCrLf
    ===================================================    
    Base64Encode  是一个 进行 base64 编码的函数, 需自己写。
    txtUser 是 需验证的用户名,txtPwd 是 密码。
    其它的 和一般的 smtp 命令一样。 你可参考 一下 那些 随处可见 的 例程。 
    再 给你 base64 的编码 和解码 部分的 函数::http://www.csdn.net/Expert/topic/422/422011.shtm 
      

  7.   

    楼上的sonicdater和acptdta,能把你们的信箱给我么?我想接触一下你们这些高手,可以么?
      

  8.   

    我想要,可以给我吗?最好带说明!![email protected]
      

  9.   

    BASE64编码解码程序 编码:BASE64 
    基本公式 
    B(1) = (Int(A(1) / 4) + 65) 
    B(2) = ((A(1) Mod 4) * 16 + Int(A(2) / 16) + 65) 
    B(3) = ((A(2) Mod 16) * 4 + Int(A(3) / 64) + 65) 
    B(4) = (A(3) Mod 64 + 65) 
    源文件特殊长度 4,8 
    编码文件每76个字符插入常数vbCrLf 
    i Private Sub Command1_Click() 
        Command1.Enabled = False 
        Dim nFileno1 As Integer 
        Dim nFileno2 As Integer 
        Dim bByte As Byte 
        Dim sInp As String 
        Dim nFilelen As Long 
        Dim A(3) As Byte 
        Dim B(4) As Byte 
        nFileno1 = FreeFile 
        Open Text1.Text For Binary As #nFileno1 
        nFileno2 = FreeFile 
        Open Text2.Text For Binary As #nFileno2 
        nFilelen = LOF(nFileno1) 
        If nFilelen = 0 Then GoTo Fail 
        If nFilelen <= 3 Then 
            If nFilelen Mod 3 = 1 Then 
               Get #nFileno1, , A(1) 
               B(1) = (Int(A(1) / 4) + 65) 
               B(2) = ((A(1) Mod 4) * 16 + 65) 
               B(3) = (61) 
               B(4) = (61) 
          Else 
               If nFilelen Mod 3 = 2 Then 
               Get #nFileno1, , A(1) 
               Get #nFileno1, , A(2) 
               B(1) = (Int(A(1) / 4) + 65) 
               B(2) = ((A(1) Mod 4) * 16 + Int(A(2) / 16) + 65) 
               B(3) = ((A(2) Mod 16) * 4 + 65 + 1) 
               B(4) = (61) 
             Else 
               Get #nFileno1, , A(1) 
               Get #nFileno1, , A(2) 
               Get #nFileno1, , A(3) 
               B(1) = (Int(A(1) / 4) + 65) 
               B(2) = ((A(1) Mod 4) * 16 + Int(A(2) / 16) + 65) 
               B(3) = ((A(2) Mod 16) * 4 + Int(A(3) / 64) + 65) 
               B(4) = (A(3) Mod 64 + 65) 
               End If 
            End If 
            For nI = 1 To 4 Step 1 
               If B(nI) > 90 And B(nI) <= 116 Then 
              B(nI) = B(nI) + 6 
             Else 
               If B(nI) > 116 And B(nI) <= 126 Then 
              B(nI) = B(nI) - 69 
             Else 
               If B(nI) = 127 Then B(nI) = 43 
               If B(nI) = 128 Then B(nI) = 47 
               End If 
               End If 
            Next nI 
            Put #nFileno2, , B(1) 
            Put #nFileno2, , B(2) 
            Put #nFileno2, , B(3) 
            Put #nFileno2, , B(4) 
      Else 
            nJ = Int(nFilelen / 3) * 3 
            Do While Loc(nFileno1) < nJ 
               For nI = 1 To 3 Step 1 
               Get #nFileno1, , (A(nI)) 
               Next nI 
               B(1) = (Int(A(1) / 4) + 65) 
               B(2) = ((A(1) Mod 4) * 16 + Int(A(2) / 16) + 65) 
               B(3) = ((A(2) Mod 16) * 4 + Int(A(3) / 64) + 65) 
               B(4) = (A(3) Mod 64 + 65) 
               For nI = 1 To 4 Step 1 
               If B(nI) > 90 And B(nI) <= 116 Then 
              B(nI) = B(nI) + 6 
             Else 
               If B(nI) > 116 And B(nI) <= 126 Then 
              B(nI) = B(nI) - 69 
             Else 
               If B(nI) = 127 Then B(nI) = 43 
               If B(nI) = 128 Then B(nI) = 47 
               End If 
               End If 
               Next nI 
               Put #nFileno2, , B(1) 
               Put #nFileno2, , B(2) 
               Put #nFileno2, , B(3) 
               Put #nFileno2, , B(4) 
               If Int((Loc(nFileno2) + 2) / 78) = (Loc(nFileno2) + 2) / 78 Then 
               Put #nFileno2, , vbCrLf 
               End If 
          Loop 
            If nFilelen Mod 3 = 1 Then 
               Get #nFileno1, , A(1) 
               B(1) = (Int(A(1) / 4) + 65) 
               B(2) = ((A(1) Mod 4) * 16 + 65) 
               If nFilelen = 4 Then B(2) = B(2) + 3 
               B(3) = (61) 
               B(4) = (61) 
               For nI = 1 To 4 Step 1 
               If B(nI) > 90 And B(nI) <= 116 Then 
              B(nI) = B(nI) + 6 
             Else 
               If B(nI) > 116 And B(nI) <= 126 Then 
              B(nI) = B(nI) - 69 
             Else 
               If B(nI) = 127 Then B(nI) = 43 
               If B(nI) = 128 Then B(nI) = 47 
               End If 
               End If 
               Next nI 
               Put #nFileno2, , B(1) 
               Put #nFileno2, , B(2) 
               Put #nFileno2, , B(3) 
               Put #nFileno2, , B(4) 
               If Int((Loc(nFileno2) + 2) / 78) = (Loc(nFileno2) + 2) / 78 Then 
               Put #nFileno2, , vbCrLf 
               End If 
          Else 
               If nFilelen Mod 3 = 2 Then 
               Get #nFileno1, , A(1) 
               Get #nFileno1, , A(2) 
               B(1) = (Int(A(1) / 4) + 65) 
               B(2) = ((A(1) Mod 4) * 16 + Int(A(2) / 16) + 65) 
               B(3) = ((A(2) Mod 16) * 4 + 65) 
               If nFilelen = 8 Then B(3) = B(3) + 1 
               B(4) = (61) 
               For nI = 1 To 4 Step 1 
               If B(nI) > 90 And B(nI) <= 116 Then 
              B(nI) = B(nI) + 6 
             Else 
               If B(nI) > 116 And B(nI) <= 126 Then 
              B(nI) = B(nI) - 69 
             Else 
               If B(nI) = 127 Then B(nI) = 43 
               If B(nI) = 128 Then B(nI) = 47 
               End If 
               End If 
               Next nI 
               Put #nFileno2, , B(1) 
               Put #nFileno2, , B(2) 
               Put #nFileno2, , B(3) 
               Put #nFileno2, , B(4) 
               If Int((Loc(nFileno2) + 2) / 78) = (Loc(nFileno2) + 2) / 78 Then 
               Put #nFileno2, , vbCrLf 
               End If 
               End If 
            End If 
        End If 
        MsgBox Str(nFilelen), vbOKOnly 
       'MsgBox Str(Loc(nFileno1)), vbOKOnly 
        Close #nFileno1 
        Close #nFileno2 
        Command1.Enabled = True 
        Exit Sub 
    Fail: 
        MsgBox "打开文件长度为零,无法编码!", , "警告" 
    End Sub 
    解码: 
    基本公式 
    A(1)=((B(1)-65) mod 64)*4 + int((B(2)-65)/16) 
    A(2)=((B(2)-65) mod 16)*16 + int((B(3)-65)/4) 
    A(3)=((B(3)-65) mod 4)*64 + (B(4)-65) Private Sub Command2_Click() 
        Command2.Enabled = False 
        Dim nFileno1 As Integer 
        Dim nFileno2 As Integer 
        Dim bByte As Byte 
        Dim sInp1 As Byte 
        Dim sInp2 As Byte 
        Dim nFilelen As Long 
        Dim A(3) As Byte 
        Dim B(4) As Byte     Dim Infomation As String 
        Infomation = "From: <[email protected]>" + Chr(13) + Chr(10) _ 
               + "To: <[email protected]>" + Chr(13) + Chr(10) _ 
               + "Cc: " + Chr(13) + Chr(10) _ 
               + "Subject: Test" + Chr(13) + Chr(10) _ 
               + "Date: Wed,21 Feb 2001 20:00:00" + Chr(13) + Chr(10) 
        nFileno1 = FreeFile 
        Open Text2.Text For Binary As #nFileno1 
        nFileno2 = FreeFile 
        Open Text3.Text For Binary As #nFileno2 
        'Put #nFileno2, , Infomation 
        nFilelen = LOF(nFileno1) 
        Do While Loc(nFileno1) < nFilelen 
            If Int((Loc(nFileno1) + 2) / 78) = _ 
               ((Loc(nFileno1) + 2) / 78) Then 
               Get #nFileno1, , B(1) 
               Get #nFileno1, , B(1) 
            End If 
            For nI = 1 To 4 Step 1 
               Get #nFileno1, , B(nI) 
               If B(nI) = 43 Then 
              B(nI) = 127 
               GoTo NINEXT 
               End If 
               If B(nI) = 47 Then 
              B(nI) = 128 
               GoTo NINEXT 
               End If 
               If B(nI) > 47 And B(nI) <= 57 Then 
              B(nI) = B(nI) + 69 
               GoTo NINEXT 
               End If 
               If B(nI) > 96 And B(nI) <= 122 Then 
              B(nI) = B(nI) - 6 
               GoTo NINEXT 
               End If 
    NINEXT: 
            Next nI 
           If B(3) = 61 Then 
               A(1) = ((B(1) - 65) Mod 64) * 4 + Int((B(2) - 65) / 16) 
               Put #nFileno2, , A(1) 
               GoTo Endtranslat 
            End If 
           If B(4) = 61 Then 
               A(1) = ((B(1) - 65) Mod 64) * 4 + Int((B(2) - 65) / 16) 
               A(2) = ((B(2) - 65) Mod 16) * 16 + Int((B(3) - 65) / 4) 
               Put #nFileno2, , A(1) 
               Put #nFileno2, , A(2) 
               GoTo Endtranslat 
            End If 
            A(1) = ((B(1) - 65) Mod 64) * 4 + Int((B(2) - 65) / 16) 
            A(2) = ((B(2) - 65) Mod 16) * 16 + Int((B(3) - 65) / 4) 
            A(3) = ((B(3) - 65) Mod 4) * 64 + (B(4) - 65) 
            Put #nFileno2, , A(1) 
            Put #nFileno2, , A(2) 
            Put #nFileno2, , A(3) 
    Endtranslat: 
      Loop 
        Close #nFileno1 
        Close #nFileno2 
        Command2.Enabled = True 
    End Sub