如何删除特定的电子邮件 [英] how to delete a specific email
本文介绍了如何删除特定的电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用vb.net Windows窗体应用程序删除特定电子邮件..
我有源代码,我想使用此程序删除电子邮件..帮帮我...
how to delete a specific email using vb.net windowsforms appllication..
i have source code i want to delete email using this programe.. help me...
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
NotifyIcon1.Visible = True
Timer1.Enabled = True
Me.Hide()
Me.ShowInTaskbar = False
Left = (SystemInformation.WorkingArea.Size.Width - Size.Width)
Top = (SystemInformation.WorkingArea.Size.Height - Size.Height)
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Me.Show()
If tempCounter >= mailCount Then
Timer1.Enabled = False
Me.Hide()
Else
lblFrom.Text = "From : " & emailFrom(tempCounter)
lblMessage.Text = "Subject : " & emailMessages(tempCounter)
tempCounter += 1
End If
End Sub
Private Sub lblMessage_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles lblMessage.TextChanged
If lblMessage.Text = "" Then
ElseIf lblMessage.Text = "" Then
ElseIf lblMessage.Text = "" Then
ElseIf lblMessage.Text = "" Then
End If
End Sub
End Class
Module GlobalVariables
Public emailFrom(1), emailMessages(1) As String
Public tempCounter As Int16 = 0
Public mailCount As Int16 = 0
End Module
Imports System.Xml
Imports System.Text
Public Class LoginForm1
Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click
End Sub
Private Sub LoginForm1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
UsernameTextBox.Text = "madushka.prasad"
PasswordTextBox.Text = "930400297v"
Dim objClient As New System.Net.WebClient
Dim nodelist As XmlNodeList
Dim node As XmlNode
Dim response As String
Dim xmlDoc As New XmlDocument
Try
objClient.Credentials = New System.Net.NetworkCredential(UsernameTextBox.Text.Trim, PasswordTextBox.Text.Trim)
response = Encoding.UTF8.GetString(objClient.DownloadData("https://mail.google.com/mail/feed/atom"))
response = response.Replace("<feed version=""0.3"" xmlns=""http://purl.org/atom/ns#"">", "<feed>")
xmlDoc.LoadXml(response)
node = xmlDoc.SelectSingleNode("/feed/fullcount")
mailCount = node.InnerText ''Get the number of unread emails
If mailCount > 0 Then
ReDim emailFrom(mailCount - 1)
ReDim emailMessages(mailCount - 1)
nodelist = xmlDoc.SelectNodes("/feed/entry")
node = xmlDoc.SelectSingleNode("title")
For Each node In nodelist
emailMessages(tempCounter) = node.ChildNodes.Item(0).InnerText
emailFrom(tempCounter) = node.ChildNodes.Item(6).ChildNodes(0).InnerText
tempCounter += 1
Next
tempCounter = 0
End If
Me.Hide()
Form1.Show()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
End Class
推荐答案
使用下面的文章,您下载与电子邮件关联的POP3 ID,并使用该POP3 ID从帐户中下载/删除
CodeProject文章:Qmail客户端 [
Using the article below, You download the POP3 ID''s associated with the email and use that to download / delete from the account
CodeProject Article: Qmail client[^]
通过搜索google或任何搜索引擎网站.
By searching google or any search engine site.
这篇关于如何删除特定的电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文