Examples of timing detection emails and automatically forwarded

xiaoxiao2021-03-06  70

What we use here is a DLL control, this control is very powerful, you can go to http://www.hi-ho.ne.jp/babaq/eng/basp21.html to download and install this control, let me come Tell a specific implementation method and code

First, I wrote a DLL, call the downloaded DLL, provide several interfaces, can fill in the sender and acceptor, etc., this control code is as follows:

Imports Basp21libimports System.ioImports System.io.Directory

Public Shared Sub send (ByVal sendadd As String, ByVal resvAdd As String, ByVal subject As String, ByVal content As String) Dim basptest As New BASP21Lib.Basp21 basptest.SendMail ( "192.168.1.19", sendadd, resvAdd, subject, content, "") End Sub Public Shared Sub checkmail (ByVal tesadd As String, ByVal password As String) Dim basptest As New BASP21Lib.Basp21 Dim test As String Dim resvAdd As String Dim arrFile As Object Dim eachF As Object Dim strMailInfo As String Dim strLast As Object Dim Thepath AS String Dim Mes As Object Dim Message As String Thepath = getCurrentDirectory () & CSTR ("/ mail") strmailinfo = "from: to: x-to: cc: x-cc: bcc: Subject: Date: Mime -Version: "&" Content-Type: X-Priority: X-MAILER: X-MimeEole: "Arrfile = Basptest.rcvmail (" 192.168.1.19 ", tesadd, password," saveAlld ", Thepath ) If isarray (arrfile) = false thr For Each eachF In arrFile strLast = basptest.ReadMail (eachF, strMailInfo, thePath) For Each mes In strLast message = message & mes & vbCrLf Next mes Next eachF basptest.SendMail ( "192.168.1.19", "xxx@iddddia.com" , "xxx@ixxx.net.cn", "DDDDD", "DDDDDDDDDDDDDDDDDDDDDDD", "") End Subend Class then we use system services to call this DLL, the code is as follows:

Protected Overrides Sub onstart (Byval args () AS String) 'サ サ ビ ビ す め コ コ ド を ここ に に 追...... に に に........ す す. す..こ こ メソ ド ド, set the を 行 い がら がら が げ られ い よ よ に に げ げ. DIM TIMER1 AS New Timer Timer1.interval = 1000 Timer1.Nabled = True End Subprotected Overrides Sub onStop () 'サ サ ビ ビ を に に 要 终 终 终 実 実 终 终 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実 実End Sub

Private Sub Timer1_Elapsed (ByVal sender As System.Object, ByVal e As System.Timers.ElapsedEventArgs) Handles Timer1.Elapsed newmail.newmailclass.checkmail ( "ss@eee.net.cn", "werwer") End SubEnd Class

Automatically implement mail forwarding and send mail function, make system services, call this DLL, set to automatic start, you will have a function of your machine (providing users)

转载请注明原文地址:https://www.9cbs.com/read-118703.html

New Post(0)