473,713 Members | 2,763 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Receiving email with VB.NET

I am researching this topic without a satisfactory solution so far.
Please let me know which is the easiest way to receive email using VB
code. All I need is to test source address or subject line for the
right email, and then click a link inside that email.
I've seen some people suggested MAPI component, but it's missing in my
complete components list (not only in the toolbar). But I see an
Outlook Express component, which I suspect is easier to use than
Outlook or CDO objects. Anyway, I am looking for something that will
be available on any machine, and not only on one with Outlook
installed.
Nov 21 '05 #1
5 19583
What is your environment? If you have an exchange server you could use
WebDAV... which does not require Outlook.
"sophocles the wise" <ap****@nyc.rr. com> wrote in message
news:1f******** *************** **@posting.goog le.com...
I am researching this topic without a satisfactory solution so far.
Please let me know which is the easiest way to receive email using VB
code. All I need is to test source address or subject line for the
right email, and then click a link inside that email.
I've seen some people suggested MAPI component, but it's missing in my
complete components list (not only in the toolbar). But I see an
Outlook Express component, which I suspect is easier to use than
Outlook or CDO objects. Anyway, I am looking for something that will
be available on any machine, and not only on one with Outlook
installed.

Nov 21 '05 #2
Thanks for the reply :-)
I am not in Exchange environment. Just regular computer. I need my
application to run on any computer. If Outlook is a must, then let it
be... as soon as I am shown how to access its interface.

Alex

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 21 '05 #3
Check out Abderaware's mail products (www.abderaware.com). They're .Net
assemblies, and provide what seems to be complete functionality for
receiving email. I've used it to create an email screener for my own use, to
classify spam and delete it before running Outlook to receive my email. You
can download a copy of it, free for personal use, and evaluate it before
purchasing. They've got a whole slew of network products - FTP, SNMP, etc.

HTH,
Tom Dacon
Dacon Software Consulting

"sophocles the wise" <ap****@nyc.rr. com> wrote in message
news:1f******** *************** **@posting.goog le.com...
I am researching this topic without a satisfactory solution so far.
Please let me know which is the easiest way to receive email using VB
code. All I need is to test source address or subject line for the
right email, and then click a link inside that email.
I've seen some people suggested MAPI component, but it's missing in my
complete components list (not only in the toolbar). But I see an
Outlook Express component, which I suspect is easier to use than
Outlook or CDO objects. Anyway, I am looking for something that will
be available on any machine, and not only on one with Outlook
installed.

Nov 21 '05 #4
Hi,

I converted this c# pop3 mail class to vb.net. Maybe this will
help.

http://www.programmersheaven.com/2/Art_CSharp_3

How to use

Dim mail As New Pop3Mail

mail.Connect("m ail.xxxx.net", "user", "password")

For Each msg As Pop3Mail.Pop3Me ssage In mail.List

Trace.WriteLine (DirectCast(mai l.Retrieve(msg) ,
Pop3Mail.Pop3Me ssage).message)

Next

The class

Imports System.Net.Sock ets

Public Class Pop3Mail

Inherits System.Net.Sock ets.TcpClient

Public Class Pop3Exception

Inherits System.Applicat ionException
Public Sub New(ByVal str As String)

MyBase.New(str)
End Sub 'New

End Class 'Pop3Exception

Public Class Pop3Message

Public number As Long

Public bytes As Long

Public retrieved As Boolean

Public message As String

End Class 'Pop3Message

Public Overloads Sub Connect(ByVal server As String, ByVal username As
String, ByVal password As String)

Dim message As String

Dim strResponse As String

Connect(server, 110)

strResponse = Response()

If strResponse.Sub string(0, 3) <> "+OK" Then

Throw New Pop3Exception(R esponse)

End If

message = "USER " + username + vbCr + vbLf

Write(message)

strResponse = Response()

If strResponse.Sub string(0, 3) <> "+OK" Then

Throw New Pop3Exception(s trResponse)

End If

message = "PASS " + password + vbCr + vbLf

Write(message)

strResponse = Response()

If strResponse.Sub string(0, 3) <> "+OK" Then

Throw New Pop3Exception(s trResponse)

End If

End Sub 'Connect

Public Sub Disconnect()

Dim message As String

Dim strResponse As String

message = "QUIT" + vbCr + vbLf

Write(message)

strResponse = Response()

If strResponse.Sub string(0, 3) <> "+OK" Then

Throw New Pop3Exception(s trResponse)

End If

End Sub 'Disconnect

Public Function List() As ArrayList

Dim message As String

Dim strResponse As String

Dim retval As New ArrayList

message = "LIST" + vbCr + vbLf

Write(message)

strResponse = Response()

If strResponse.Sub string(0, 3) <> "+OK" Then

Throw New Pop3Exception(s trResponse)

End If

While True

strResponse = Response()

If strResponse = "." & vbCr & vbLf Then

Return retval

Else

Dim msg As New Pop3Message

Dim seps As Char() = " ".ToCharArr ay

Dim values As String() = strResponse.Spl it(seps)

msg.number = Int32.Parse(val ues(0))

msg.bytes = Int32.Parse(val ues(1))

msg.retrieved = False

retval.Add(msg)

End If

End While

End Function 'List

Public Function Retrieve(ByVal rhs As Pop3Message) As Pop3Message

Dim message As String

Dim strResponse As String

Dim msg As New Pop3Message

msg.bytes = rhs.bytes

msg.number = rhs.number

message = "RETR " & rhs.number & vbCr & vbLf

Write(message)

strResponse = Response()

If strResponse.Sub string(0, 3) <> "+OK" Then

Throw New Pop3Exception(s trResponse)

End If

msg.retrieved = True

While True

strResponse = Response()

If strResponse = "." & vbCr & vbLf Then

Exit While

Else

msg.message += strResponse

End If

End While

Return msg

End Function 'Retrieve

Private Sub Write(ByVal message As String)

Dim en As New System.Text.ASC IIEncoding

Dim WriteBuffer(102 3) As Byte

WriteBuffer = en.GetBytes(mes sage)

Dim stream As NetworkStream = GetStream()

stream.Write(Wr iteBuffer, 0, WriteBuffer.Len gth)

Debug.WriteLine ("WRITE:" + message)

End Sub 'Write

Public Sub Delete(ByVal rhs As Pop3Message)

Dim message As String

Dim strResponse As String

message = "DELE " & rhs.number & vbCr & vbLf

Write(message)

strResponse = Response()

If strResponse.Sub string(0, 3) <> "+OK" Then

Throw New Pop3Exception(s trResponse)

End If

End Sub 'Delete

Private Function Response() As String

Dim enc As New System.Text.ASC IIEncoding

Dim serverbuff() As Byte = New [Byte](1023) {}

Dim stream As NetworkStream = GetStream()

Dim count As Integer = 0

While True

Dim buff() As Byte = New [Byte](1) {}

Dim bytes As Integer = stream.Read(buf f, 0, 1)

If bytes = 1 Then

serverbuff(coun t) = buff(0)

count += 1

If buff(0) = Asc(vbLf) Then

Exit While

End If

Else

Exit While

End If

End While

Dim retval As String = enc.GetString(s erverbuff, 0, count)

Debug.WriteLine ("READ:" + retval)

Return retval

End Function 'Response

End Class

Ken

---------------------------------
"sophocles the wise" <ap****@nyc.rr. com> wrote in message
news:1f******** *************** **@posting.goog le.com...
I am researching this topic without a satisfactory solution so far.
Please let me know which is the easiest way to receive email using VB
code. All I need is to test source address or subject line for the
right email, and then click a link inside that email.
I've seen some people suggested MAPI component, but it's missing in my
complete components list (not only in the toolbar). But I see an
Outlook Express component, which I suspect is easier to use than
Outlook or CDO objects. Anyway, I am looking for something that will
be available on any machine, and not only on one with Outlook
installed.
Nov 21 '05 #5
Sophocles,
Anyway, I am looking for something that will
be available on any machine, and not only on one with Outlook
installed. In addition to the other 3rd party suggestions.

Matthew MacDonald's book "Microsoft Visual Basic .NET Programmer's Cookbook"
from MS Press has a topic on how to retrieve email using POP3, complete with
a sample class.

Hope this helps
Jay

"sophocles the wise" <ap****@nyc.rr. com> wrote in message
news:1f******** *************** **@posting.goog le.com...I am researching this topic without a satisfactory solution so far.
Please let me know which is the easiest way to receive email using VB
code. All I need is to test source address or subject line for the
right email, and then click a link inside that email.
I've seen some people suggested MAPI component, but it's missing in my
complete components list (not only in the toolbar). But I see an
Outlook Express component, which I suspect is easier to use than
Outlook or CDO objects. Anyway, I am looking for something that will
be available on any machine, and not only on one with Outlook
installed.

Nov 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2017
by: aa | last post by:
If I pass parameters to a PHP script in URL like ..php?a=aa&b=bb how do I recover them on the receiving PHP end? I looked at the list of PHP Variables using phpinfo() and found nothing suitable
4
4811
by: Ramiro Barbosa, Jr. | last post by:
All, In regards to the call below, I was wondering why is it that the 'szMessage' receiving buffer results in an empty one, but by printing 'ret' it indicates the number of bytes I am indeed receiving! int ret = recvfrom(receivingSocket,szMessage,sizeof(szMessage),0,sockaddr*)&addr_Cli, &clilen); Any ideas?
1
1677
by: Sajsal | last post by:
Hi all I am developing a web app in which the client wants an email sending and receiving functionality. Is it possible in C#. If yes where should I start. If anyone could tell that how long would it take to develop and the human resources etc I'll be very thankful Regards
0
1265
by: André Betz | last post by:
Hi, I've established a TCP-Socket Connection and now I want to receive datas. So I called BeginReceive where I set the receiving buffer and length. Now in the asynchronous CallBack-Function I call EndReceive and get the length of rceived datas. After receiving datas I call the Beginreceive-Function again. So my question is now what is if the send datas is greater than the receiving buffer? Ok, I know, I will get it in the next...
1
1221
by: Jigar Mehta | last post by:
Hye friends!!! Jigar Mehta from India. Currently making one program in VC++ like outlook express that sends and receives mails from the server (pop3, and smtp server only)... I can not find commands that are needed for communication with server for receiving a mail with attachment.. Currently I am able to get the mail without attachment (through socket programming only).. So, please help me if you know any reference from where I can get...
2
1677
by: mamatha | last post by:
Hi, I want to send Email in VB to mutiple users through SMTP and receiving emails thruegh IMAP.How can i built.If any one knows the source code or URL please let me know Mamatha
1
2677
by: Subrato | last post by:
Hi, I am very new to xml and I have this piece of code which I took off a website. The situation is that on of the website, user files up a form and it is submitted. On submission, the page should do a xml post to my site. On receiving the xml on my end, I take that data and insert it into sql server table. I dont know whats missing . Here is the piece of code I use for my testing. 'Sending
7
3179
by: darthghandi | last post by:
I am having mixed results with asynchronous socket receives. Sometimes I get the right information back from the buffer, other times I get some of the data that should be in the buffer printed out to the console. That data is printed out to the console before I even call Socket.EndReceive(). After that call, I get the rest of the data that wasn't printed out to the console in the buffer. Anyone have any idea what is going on? Here's...
0
8795
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9306
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9168
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9068
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9009
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7942
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4462
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4715
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2103
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.