minfo.dllÊÇÎÒ×öµÄÒ»¸öÊÕ·¢ÓʼþµÄ¶¯Ì¬Á¬½Ó¿â£¬Ä¿Ç°ÊDzâÊÔ°æ¡£¿ÉÒÔ´Óhttp://xlrj.com/amÏÂÔØ¡£ÒÔÏÂÊÇreadme.txtµÄÄÚÈÝ£º
ÕâÊDzâÊÔ°æ±¾£¬Ç뽫MINFO.DLL·ÅÈëϵͳĿ¼£¨ÀýÈ磺c:windowssystem£©
minfo.dll°üÀ¨ÒÔÏÂapi:
Public Declare Function Logon Lib "minfo.dll" (popinfo As popinfo, ByVal er As String) As Long
µÇ¼pop3·þÎñÆ÷£¬Èç¹û³É¹¦£¬Ó¦Ê¹ÓÃLogoffÍ˳ö¡£
Public Declare Function DeleteMail Lib "minfo.dll" (ByVal nIndex As Long, ByVal er As String) As Long
ɾ³ýÖ¸¶¨µÄÓʼþ
Public Declare Function GetMailInfo Lib "minfo.dll" (mount As Long, minfo As Long, ByVal er As String) As Long
»ñÈ¡ÓʼþÐÅÏ¢£¬°üÀ¨ÓʼþÊýÄ¿£¬Óʼþ±êÌâ¡¢·¢¼þÈË¡¢Óʼþ³¤¶È¡¢ÓʼþÈÕÆÚ
Public Declare Function GetMailData Lib "minfo.dll" (ByVal nIndex As Long, ByVal filename As String, ByVal er As String) As Long
»ñȡָ¶¨µÄÓʼþÄÚÈÝ£¬²¢´æÈëÎļþ
Public Declare Sub Logoff Lib "minfo.dll" ()
Í˳öpop3Óʼþ·þÎñÆ÷
Public Declare Function Encode Lib "minfo.dll" (data As Byte, ByVal l As Long, rtnlong As Long) As Long
base64±àÂë×Ö½ÚÊý×é
Public Declare Function Decode Lib "minfo.dll" (data As Byte, l As Long) As Long
base64½âÂë×Ö½ÚÊý×é
Public Declare Function SendMail Lib "minfo.dll" (smtpin As smtpinfo, maildata As Byte, ByVal subject As String, ByVal attachment As String, ByVal er As String) As Long
·¢ËÍÓʼþ
test.xlsÌṩÁËʹÓÃÕâЩapiµÄһЩ·¶Àý¡£ÒÔÏÂÊǸÃÎļþµÄVBA´úÂ룺
Type popinfo
user As String 'Óû§Ãû
pass As String 'ÃÜÂë
popsvr As String '½ÓÊÕÓʼþ·þÎñÆ÷
End Type
Type mailinfo
from As Long '·¢¼þÈË
subject As Long 'ÓʼþÖ÷Ìâ
date As Long 'ÓʼþÈÕÆÚ
mlen As Long 'Óʼþ³¤¶È
End Type
Type smtpinfo
smtpsvr As String 'smtp·þÎñÆ÷
sender As String '·¢¼þÈË
receiver As String 'ÊÕ¼þÈË£¬¶à¸öÊÕ¼þÈËÓà , ¸ô¿ª
auth As Long 'ÊÇ·ñÐèÒªAUTHÈÏÖ¤ 1 ÐèÒª 0 ²»ÐèÒª
user As String 'Óû§Ãû
pass As String 'ÃÜÂë
End Type
Public Declare Sub Logoff Lib "minfo.dll" ()
Public Declare Function Logon Lib "minfo.dll" (popinfo As popinfo, ByVal er As String) As Long
Public Declare Function DeleteMail Lib "minfo.dll" (ByVal nIndex As Long, ByVal er As String) As Long
Public Declare Function SendMail Lib "minfo.dll" (smtpin As smtpinfo, maildata As Byte, ByVal subject As String, ByVal attachment As String, ByVal er As String) As Long '·¢ËÍÓʼþ
Public Declare Function GetMailInfo Lib "minfo.dll" (mount As Long, minfo As Long, ByVal er As String) As Long '»ñÈ¡ÓʼþÐÅÏ¢
Public Declare Function Encode Lib "minfo.dll" (data As Byte, ByVal l As Long, rtnlong As Long) As Long 'BASE64±àÂë
Public Declare Function Decode Lib "minfo.dll" (data As Byte, l As Long) As Long 'BASE64½âÂë
Public Declare Function GetMailData Lib "minfo.dll" (ByVal nIndex As Long, ByVal filename As String, ByVal er As String) As Long '»ñÈ¡ÓʼþÄÚÈÝ
Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal length As Long)
Public 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
Sub EncodeIt()
Dim hh() As Byte '±àÂëǰµÄ×Ö½ÚÊý×é
hh = StrConv("ΪÁËÌáǰΪÄúÌṩ·þÎñ£¬ÄúµÄÈí¼þ×÷Æ·¿ÉÒÔÏÖÔÚ¾Íͨ¹ýÎÒÃǵÄϵͳ×Ô¶¯¼ÓÈë¡£", vbFromUnicode) '±»±àÂëµÄ×Ö½ÚÊý×é
Dim ll As Long '±àÂëºó×Ö½ÚÊý×鵨ַ
Dim rlong As Long '±àÂëºó³¤¶È
ll = Encode(hh(0), UBound(hh) + 1, rlong) 'UBound(hh) + 1ÊÇ´ý½âÂë×Ö½ÚÊý×鳤¶È
Dim lll() As Byte
ReDim lll(rlong - 1)
CopyMemory lll(0), ByVal ll, rlong
Dim llll As String
llll = StrConv(lll, vbUnicode)
MsgBox llll
End Sub
Sub DecodeIt()
Dim gg() As Byte '´ý½âÂë×Ö½ÚÊý×é
Dim bb As Long '½âÂëºó×Ö½ÚÊý×鵨ַ
Dim m As Long '½âÂëºó×Ö½ÚÊý×éµÄ³¤¶È
Dim ff As String
ff = "PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMCBUcmFuc2l0aW9uYWwv"
ff = ff & vbCrLf & "PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMCBUcmFuc2l0aW9uYWwv"
ff = ff & vbCrLf & "dD0idGV4dC9odG1sOyBjaGFyc2V0PWdiMjMxMiI+DQo8TUVUQSBjb250ZW50PSJNU0hUTUwgNi4w"
ff = ff & vbCrLf & "MC4yNzE1LjQwMCIgbmFtZT1HRU5FUkFUT1I+DQo8U1RZTEU+PC9TVFlMRT4NCjwvSEVBRD4NCjxC"
ff = ff & vbCrLf & "T0RZIGJnQ29sb3I9I2ZmZmZmZj4NCjxESVY+PEZPTlQgc2l6ZT0yPsTjw8e1xMjtvP7K1NPDyrHD"
ff = ff & vbCrLf & "3MLryuTKssO0PC9GT05UPjwvRElWPjwvQk9EWT48L0hUTUw+DQo="
gg = StrConv(ff, vbFromUnicode)
bb = Decode(gg(0), m)
Dim cc() As Byte
ReDim cc(m - 1)
CopyMemory cc(0), ByVal bb, m
Dim dd As String
dd = StrConv(cc, vbUnicode)
MsgBox dd
End Sub
Sub GetMail()
On Error GoTo BBB
Dim info1 As popinfo
info1.user = "whypop3" 'Óû§Ãû
info1.pass = "whypop3" 'ÃÜÂë
info1.popsvr = "pop.163.com" 'pop3Óʼþ·þÎñÆ÷
Dim info2() As mailinfo '×÷ΪÓʼþÐÅÏ¢½«±»·µ»Ø
Dim s As String '³ö´íÐÅÏ¢
Dim rc As Long '1,´ú±í³É¹¦£¬0,ʧ°Ü
Dim c As Long 'ÓʼþÊýÄ¿
Dim temp As Long 'ÓʼþÐÅÏ¢µØÖ·
Dim n As Long
s = String(255, Chr(0))
rc = Logon(info1, s)
If rc = 0 Then
MsgBox s
Exit Sub
End If
rc = GetMailInfo(c, temp, s)
If rc = 0 Then
MsgBox s
ElseIf c = 0 Then
MsgBox "ÄúûÓÐÐÂÓʼþ"
Else
ReDim info2(c - 1)
CopyMemory info2(0), ByVal temp, Len(info2(0)) * c
vv = "Äú¹²ÓÐ" & c & "·âÓʼþ"
For i = 0 To c - 1
Dim from As String
Dim subject As String
Dim dat As String
Dim lenth As Long
CopyMemory from, info2(i).from, 4
CopyMemory subject, info2(i).subject, 4
CopyMemory dat, info2(i).date, 4
CopyMemory lenth, info2(i).mlen, 4
vv = vv & vbCrLf & vbCrLf & "·¢¼þÈË£º" & Left(from, InStr(from, Chr(0)) - 1)
vv = vv & " " & "Ö÷Ì⣺" & Left(subject, InStr(subject, Chr(0)) - 1)
vv = vv & " " & "³¤¶È£º" & lenth
vv = vv & " " & "·¢¼þÈÕÆÚ£º" & Left(dat, InStr(dat, Chr(0)) - 1)
Next
MsgBox vv
s = String(255, Chr(0))
Dim l1 As Long
l1 = GetMailData(1, "e: emp.eml", s) '1 ÓʼþÐòºÅ£¬ "e: emp.eml" ´æ´¢µ½ÎļþÃû
If l1 = 0 Then
MsgBox s
GoTo BBB
End If
ShellExecute 0, "open", "e: emp.eml", "", "", SW_SHOWNORMAL
DeleteMail 1, s '1 ÓʼþÐòºÅ
MsgBox s
End If
BBB:
Logoff
End Sub
Sub sendemail()
Dim smtpin As smtpinfo
Dim s As String
s = String(255, Chr(0))
smtpin.sender = "whypop3@163.COM"
smtpin.receiver = "whypop3@163.com"
smtpin.smtpsvr = "smtp.163.com"
smtpin.auth = 1
smtpin.user = "whypop3"
smtpin.pass = "whypop3"
Dim gg As String
gg = vbCrLf & vbCrLf & "hello!everybody!!!"
Dim dby() As Byte
dby = StrConv(gg, vbFromUnicode)
Dim rc As Long
rc = SendMail(smtpin, dby(0), "²âÊÔ³ÌÐò", "e: emp.eml" & Chr(34) & "e: emp.exe", s) '¼¸¸ö²ÎÊý·Ö±ðΪsmtpinfo½á¹¹£¬ÓʼþÄÚÈÝ×Ö½ÚÊý×飬Ö÷Ì⣬¸½¼þÃû³Æ£¨Óà " ¸ô¿ª¶à¸ö¸½¼þ£©£¬³ö´íÐÅÏ¢
If rc = 1 Then
MsgBox "·¢Ëͳɹ¦£¡"
Else
MsgBox "·¢ËÍʧ°Ü£¡" & vbCrLf & s
End If
End Sub
²âÊÔ°æÊÇÃâ·ÑµÄ£¬Ï£ÍûÅóÓÑÃÇÄܸøÓ轨ÉèÐÔµÄÒâ¼û¡£¶ÔÓÚÔÚ²âÊÔ¹ý³ÌÖиøÎÒ°ïÖúµÄÅóÓÑ£¬ÒÔºó½«ÔöÓëÕýʽ°æ¡£
Õýʽ°æ½«°üÀ¨£º
1.minfo.dll
2.Ïêϸ¶øÍ걸µÄ°ïÖúÎĵµ
3.CÔÐ͵Ä˵Ã÷
4.¿ÉÄÜ»á°üÀ¨Ò»¸öActiveX¿Ø¼þ£¬¶ÔÕâЩAPI½øÐзâ×°£¬ÒÔ·½±ãÔڽű¾ÓïÑÔÖÐʹÓá£
°¬Ä¬ÍøÒ³Èí¼þÉè¼Æ¹¤×÷ÊÒ
qaymuic@163.com
| ×ÔÓÉ¹ã¸æÇø |
| ¡¡ |