Helpful Information
 
 
Category: Visual Basic Programming
Read E-mail on its receipt

Dear Sir

first I am thankful for the help provided by you.

I want to read the e-maild etails on receipt of the same.

e.g. I want to send reply (auto) with reference to his 'subject'

Example If user snd me e-mail with subject "Hi"
i will be sending meesage with subject as Response to "hi" from Mr.Xy and text matter as "Thanks for your e-mail we will respond you soon"


Can I read the e-mail text ?
Pleas einform me accordingly

Hi,

You would be better to use an auto-responder from your mail server for this task.

HTH.

Dear All

I donot want the 'auto responder...' I want to read th e subject and mail text too.


Please
Please
help me

I don't see your reasoning behind this.
If you are going to be doing this as a service then why not just use the tools that are already as mrTed suggested?

Use VBA in Outlook or something similar ...

Please

I need to read subject of the e-m,ail received..

Please suggest the code
or url to get this code

I will be really reallty hrateful to all of you

Select from Project>Components the Microsoft MAPI Controls

Then do the following to connect a session to your email

With MAPISession1
.UserName = strUser
.Password = strPassword
.SignOn
MAPIMessages1.SessionID = MAPISession1.SessionID
End With

Now use the MAPIMessages to retrieve email like so and reply - as an example

Private Sub Command1_Click()

Text1.Text = ""

frmMDIMain.MAPIMessages1.Fetch
Text1.Text = Text1.Text & "Message Subject = " & frmMDIMain.MAPIMessages1.MsgSubject
Text1.Text = Text1.Text & vbCrLf & "MsgOrigDisplayName = " & frmMDIMain.MAPIMessages1.MsgOrigDisplayName
strReplyName = frmMDIMain.MAPIMessages1.MsgOrigDisplayName

End Sub

Private Sub Command2_Click()

frmMDIMain.MAPIMessages1.Reply

frmMDIMain.MAPIMessages1.MsgNoteText = "Thanks for your e-mail we will respond to you soon"
frmMDIMain.MAPIMessages1.RecipAddress = strReplyName

frmMDIMain.MAPIMessages1.ResolveName

frmMDIMain.MAPIMessages1.Send

End Sub

You can also use a number of 3rd party Email components to read mail programatically from both POP3 and IMAP servers. JMail from www.dimac.net is one. CDONTS and CDOSYS also can read mail.

Easymail components is the better choice for your code!
Please find it in the google with keyword "easymail" for detail.










privacy (GDPR)