473,405 Members | 2,354 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,405 software developers and data experts.

MAPI mail

cj
My application, brx729, creates a new MAPI email message and leaves it
on the screen for the user to send. On one pc when it creates the email
if you cancel the message my program throws the error

System.Runtime.InteropServices.COMException (0x800A7D01): User cancelled
process
at MSMAPI.MAPIMessagesClass.Send(Object vDialog)
at brx729.Form1.SndMAPIMail(String subj, String msg)
at brx729.Form1.MailMenuItem_Click(Object sender, EventArgs e)
at System.Windows.Forms.MenuItem.OnClick(EventArgs e)
at System.Windows.Forms.MenuItemData.Execute()
at System.Windows.Forms.Command.Invoke()
at System.Windows.Forms.Control.WmCommand(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)
at System.Windows.Forms.ContainerControl.WndProc(Mess age& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage (Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(M essage& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)

On my pc it doesn't show any error. I have installed the program on the
network so we're using the same exe.

Here's my sub that creates the email.

Private Sub SndMAPIMail(ByVal subj As String, ByVal msg As String)
Dim myMAPISession As New MSMAPI.MAPISession
Dim myMAPIMessage As New MSMAPI.MAPIMessages

myMAPISession.DownLoadMail = False
myMAPISession.SignOn()
myMAPISession.NewSession = True

myMAPIMessage.SessionID = myMAPISession.SessionID

myMAPIMessage.Compose()

myMAPIMessage.MsgSubject = subj
myMAPIMessage.MsgNoteText = msg

myMAPIMessage.Send(True)
myMAPISession.SignOff()
myMAPISession.NewSession = False
End Sub
Any idea what is going on?
May 17 '06 #1
4 4035
cj
Hummm, putting try catch around the sub fixed the problem, or maybe I
should say symptom. Here's the new sub. New question is why did it
work? I thought after the program launched the email message it broke
all ties with it. And why did it work w/o this try catch on my pc?
Hummmm. Well, if I find out before anyone posts I'll post my findings.

Private Sub SndMAPIMail(ByVal subj As String, ByVal msg As String)
Try
Dim myMAPISession As New MSMAPI.MAPISession
Dim myMAPIMessage As New MSMAPI.MAPIMessages

myMAPISession.DownLoadMail = False
myMAPISession.SignOn()
myMAPISession.NewSession = True

myMAPIMessage.SessionID = myMAPISession.SessionID

myMAPIMessage.Compose()

myMAPIMessage.MsgSubject = subj
myMAPIMessage.MsgNoteText = msg

myMAPIMessage.Send(True)
myMAPISession.SignOff()
myMAPISession.NewSession = False
Catch
End Try
End Sub
cj wrote:
My application, brx729, creates a new MAPI email message and leaves it
on the screen for the user to send. On one pc when it creates the email
if you cancel the message my program throws the error

System.Runtime.InteropServices.COMException (0x800A7D01): User cancelled
process
at MSMAPI.MAPIMessagesClass.Send(Object vDialog)
at brx729.Form1.SndMAPIMail(String subj, String msg)
at brx729.Form1.MailMenuItem_Click(Object sender, EventArgs e)
at System.Windows.Forms.MenuItem.OnClick(EventArgs e)
at System.Windows.Forms.MenuItemData.Execute()
at System.Windows.Forms.Command.Invoke()
at System.Windows.Forms.Control.WmCommand(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)
at System.Windows.Forms.ContainerControl.WndProc(Mess age& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage (Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(M essage& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)

On my pc it doesn't show any error. I have installed the program on the
network so we're using the same exe.

Here's my sub that creates the email.

Private Sub SndMAPIMail(ByVal subj As String, ByVal msg As String)
Dim myMAPISession As New MSMAPI.MAPISession
Dim myMAPIMessage As New MSMAPI.MAPIMessages

myMAPISession.DownLoadMail = False
myMAPISession.SignOn()
myMAPISession.NewSession = True

myMAPIMessage.SessionID = myMAPISession.SessionID

myMAPIMessage.Compose()

myMAPIMessage.MsgSubject = subj
myMAPIMessage.MsgNoteText = msg

myMAPIMessage.Send(True)
myMAPISession.SignOff()
myMAPISession.NewSession = False
End Sub
Any idea what is going on?

May 17 '06 #2
Hi,

Thank you posting!

Based on the error message, the exception is thrown from the underlying
MAPI DLL, your VB.NET code seems all right. In this regard, I think you can
consult this issue in our MAPI specific newsgroup, you may get some
different ideas there:

microsoft.public.platformsdk.mapi

Thanks for your understanding.
Best regards,

Gary Chang
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

May 18 '06 #3
cj
Thanks, I didn't know about the mapi newsgroup. I'll ask there.
Gary Chang[MSFT] wrote:
Hi,

Thank you posting!

Based on the error message, the exception is thrown from the underlying
MAPI DLL, your VB.NET code seems all right. In this regard, I think you can
consult this issue in our MAPI specific newsgroup, you may get some
different ideas there:

microsoft.public.platformsdk.mapi

Thanks for your understanding.
Best regards,

Gary Chang
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

May 18 '06 #4
You are welcome. :)

Good Luck!
Best regards,

Gary Chang
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
May 19 '06 #5

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

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...
4
by: Jerry | last post by:
I am trying to create a contact using CDO 1.21. I was wondering if anyone had any sample code of how they may have done this. I am having trouble findinf documentation on how this is done. I...
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...
0
by: Kevin Quigley | last post by:
Hi, I have a web page that will send emails to various addresses, I've tried using the SmtpMail class but no matter what I try it will not work. I have an asp page that does actually work...
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...
6
by: Dennis | last post by:
I am trying to use MAPI in a vb.net 2003 application. I find that I need the Active X control MSMAPI32.ocx. If I install IIs, will this be included? I read that VB6 includes this control but not...
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
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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:
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...
0
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...

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.