473,398 Members | 2,165 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Mapi Mail service

Hi,

I'm creating the vb application using MAPI control. I've added both controls in my vb program (MapiSession & Mapimessages). Please check my below code.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2.  
  3.     'Sign on to the MAPI Session
  4.     MAPISession1.SignOn
  5.     MAPIMessages1.SessionID = MAPISession1.SessionID
  6.     MAPIMessages1.Fetch
  7.  
  8.     If MAPIMessages1.MsgCount > 0 Then
  9.  
  10.         'If there are messages, display the first one.
  11.         txtFrom.Text = MAPIMessages1.MsgOrigDisplayName
  12.         txtTo.Text = MAPIMessages1.RecipDisplayName
  13.         txtSubject.Text = MAPIMessages1.MsgSubject
  14.         txtMessage.Text = MAPIMessages1.MsgNoteText
  15.  
  16.         'Enable the buttons to allow message navigation.
  17.  
  18.         cmdBack.Enabled = True
  19.  
  20.         cmdForward.Enabled = True
  21.  
  22.         cmdSend.Enabled = True
  23.  
  24.     Else
  25.  
  26.         'No Messages? Tell the user immediately and Sign off!
  27.  
  28.         MsgBox "You have no messages”"
  29.  
  30.         MAPISession1.SignOff
  31.  
  32.         'Disable the buttons to avoid error messages
  33.  
  34.         cmdBack.Enabled = False
  35.  
  36.        cmdForward.Enabled = False
  37.  
  38.         cmdSend.Enabled = False
  39.  
  40.     End If
  41.  
  42. End Sub
When I run this application my machine get hang-up, Please help to me solve this problem.

Regards
C. Mahale
May 28 '07 #1
1 1747
Dököll
2,364 Expert 2GB
Hi,

I'm creating the vb application using MAPI control. I've added both controls in my vb program (MapiSession & Mapimessages). Please check my below code.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2.  
  3.     'Sign on to the MAPI Session
  4.     MAPISession1.SignOn
  5.     MAPIMessages1.SessionID = MAPISession1.SessionID
  6.     MAPIMessages1.Fetch
  7.  
  8.     If MAPIMessages1.MsgCount > 0 Then
  9.  
  10.         'If there are messages, display the first one.
  11.         txtFrom.Text = MAPIMessages1.MsgOrigDisplayName
  12.         txtTo.Text = MAPIMessages1.RecipDisplayName
  13.         txtSubject.Text = MAPIMessages1.MsgSubject
  14.         txtMessage.Text = MAPIMessages1.MsgNoteText
  15.  
  16.         'Enable the buttons to allow message navigation.
  17.  
  18.         cmdBack.Enabled = True
  19.  
  20.         cmdForward.Enabled = True
  21.  
  22.         cmdSend.Enabled = True
  23.  
  24.     Else
  25.  
  26.         'No Messages? Tell the user immediately and Sign off!
  27.  
  28.         MsgBox "You have no messages”"
  29.  
  30.         MAPISession1.SignOff
  31.  
  32.         'Disable the buttons to avoid error messages
  33.  
  34.         cmdBack.Enabled = False
  35.  
  36.        cmdForward.Enabled = False
  37.  
  38.         cmdSend.Enabled = False
  39.  
  40.     End If
  41.  
  42. End Sub
When I run this application my machine get hang-up, Please help to me solve this problem.

Regards
C. Mahale
Greetings, and salutations, C. Mahale!

Does your message box pop up?
What happens when you do have a message?

It looks like the program is doing what it is supposed...

Dököll
May 31 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: David Fraser | last post by:
Hi Does anyone have an idea how to send mail via the win32 mapi extensions that come with pywin32? It's very easy using Simple MAPI, but unfortunately brings up dialog boxes inn various versions...
14
by: Chris | last post by:
I'm trying to send an e-mail through outlook. So far I've gotten it to work with the mail script at http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/149461 My only problem is that when I...
3
by: Siegfried Heintze | last post by:
Does the Outlook API supersede MAPI? If I implement a SPAM filter using MAPI to automatically delete messages from the message store, will other clients like Eudora benefit? If I implement a...
5
by: Larry Bertolini | last post by:
Scenario: DBMS: SQL Server 2000 OS: Windows Server 2003 Goal: Enable SQLMAIL via Internet Mail Problem: How do I set up the MAPI profile for the SQL Server service account?
7
by: Ottar | last post by:
I've made a program sorting incomming mail in public folder. The function runs every minute by using the form.timer event. In Access XP it runs for weeks, no problem. Access 2003 runs the same...
2
by: Tor Inge Rislaa | last post by:
I have an application sending e-mail within my organization based on an existing MAPI session. The users are using Outlook as the primary e-mail program. Based on the security updates within...
0
by: PhilHip | last post by:
I've written a Windows service in VB.Net that accesses the global address list to obtain all the entries to store them in a local database. The GAL is accessed using the MS Exchange profile on the...
3
by: Siv | last post by:
Hi, A little while ago I wrote a small program that allowed the user to view products from a database. The database holds the details of the products which can be viewed via a form and...
15
by: squrel | last post by:
Hi everyone.. i need ur help once more time.... i have a form called reminder..in tht form i have: txtid, txtcaseid, txtreminder, cmbremindby(system or user), txtremindto, dtpreminddt,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
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...

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.