Click here to Skip to main content
15,909,242 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi! All,
I am trying to create a sample application: (both are separate apps.)
1)I can send an E-mail using SMTP.
2)Based on the necessary input(username & password) i can delete the SPAM mails (only for Gmail ids).
Can any one guide me, as to how to go about with this?
Posted

1)I can send an E-mail using SMTP.
Here you go:
Use ASP.NET to send Email from Website[^]
Tutorials on sending Email in ASP.NET[^]
 
Share this answer
 
Comments
Nischal Bhatt 18-Apr-11 6:13am    
Thank You & i'm stuck at the second application..
Public Class clsEmail
Public Sub clsEmail()
End Sub
Public Sub Send(ByVal pEnableSsl As Boolean, ByVal pHost As String, ByVal pPort As String, ByVal pEmailFrom As String, ByVal pTo As String, ByVal pPassword As String, ByVal pSubject As String, ByVal pBody As String, Optional ByVal pCC As String = "")
Dim smtp As New SmtpClient
smtp.EnableSsl = pEnableSsl
'Set the SMTP settings...
smtp.Host = pHost
smtp.Port = pPort
smtp.UseDefaultCredentials = False
smtp.Credentials = New NetworkCredential(pEmailFrom, pPassword)
'smtp.PickupDirectoryLocation = "C:\Mailserver\Settings\local_xml\MailStore\Mailboxes\snehal\Inbox\"
smtp.DeliveryMethod = SmtpDeliveryMethod.Network
' AddHandler smtp.SendCompleted, AddressOf Me.SendCompletedHandler
'(1) Create the MailMessage instance
Dim mm As New MailMessage()
mm.From = New MailAddress(pEmailFrom)

Dim strArr As String() = pTo.Split(";")
For Each strString In strArr
If strString <> String.Empty Then
mm.To.Add(strString)
End If
Next

Dim strArr1 As String() = pCC.Split(";")
For Each strString In strArr1
If strString <> String.Empty Then
mm.CC.Add(strString)
End If
Next


'(2) Assign the MailMessage's properties
mm.Subject = pSubject
mm.Body = pBody
mm.IsBodyHtml = True
'(4) Send the MailMessage (will use the Web.config settings)
smtp.Send(mm)
End Sub

End Class
 
Share this answer
 
Comments
Nischal Bhatt 18-Apr-11 6:13am    
Thank You & i'm stuck at the second application..
check out my tip trip at this link
Using Gmail Account to Send Emails[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900