|
-
Apr 13th, 2001, 05:23 AM
#1
Thread Starter
New Member
I developed a program using VB5 to create and send e-mails via Outlook Express using MAPI. I have since upgraded to VB6 and have been trying to make some amendments to the program. However, VB6 keeps crashing with the "This program has performed an illegal operation …". When I look at the details, it usually says the error occurred in VB6.EXE but sometimes Kernel32 or an un-named module. I've re-installed VB6 twice and applied Service pack 3 but it makes no difference. The error occurs when I run in development mode or try to compile the program. Can anyone help, please?
-
Apr 16th, 2001, 02:47 AM
#2
Hi, I'm using vb6 and I get problems like this too!
Belive it or not the solution was VERY strange! It
turned out my PC was getting to hot and causing
wierd error messages like the one you get
(on compile or exit of VB) .
Note: I have overclocked my pc, but I've added a
secondary fan and this sorts things out.
Just to add to this strangness, my wifes PC had a
problem in word 97 (and ONLY word97!!) where
sometimes the screen fonts would screw up!
After a long time trying to solve this little probem
- I opened up the case - just to see the cpu fan
had packed up. I replaced it and all was fine...
wierd or what?
Cheers
Jenk
-
Apr 19th, 2001, 02:43 AM
#3
Thread Starter
New Member
Thanks for your suggestion but, unfortunately, it doesn't seem to apply in my case. The fan is working normally and I've taken the sides off the PC to increase the cooling but the problem's still there. I'm about to take the plunge & reload everything including Windows 98.
-
Apr 25th, 2001, 10:42 AM
#4
New Member
I am having the same problem - run the app - crash, kills VB totally. However! - I just went into outlook express and set it as the default mail system. Went back to run my app and now I am getting prompted to setup my mail properly under outlook - no more crash! I have not completed this process successfully yet, but at least my app in not crapping out. Perhaps this will help you?
To set it, run outlook express, go to tools / options / general. Don't ask me how to unset it - still working on that.
Hope this will help.
-
May 9th, 2001, 04:42 AM
#5
Thread Starter
New Member
I've finally managed to get everything up & running and the good news is - the problem has gone away! I don't know what the cause was but, obviously, something in W98 or Outlook Express.
Thanks for your help.
Roy Vinyard
-
Jul 30th, 2002, 10:39 PM
#6
New Member
I'm trying to use VB to send email through Outlook Express via MAPI. Could you post some of the code to help with this, please?
Thans a lot.
patrickhenry
-
Jul 31st, 2002, 03:39 AM
#7
Thread Starter
New Member
Ensure that you add the component Microsoft MAPI Controls 6.0 to your project.
The code I used follows.
(In the actual program, I looped round the 'send message' bit with several messages to different people. I found I had to put a brief time delay after each one to get it to work properly).
Public Sub SendeMail (ToName As string, ToEMailAddress As String, ThisMessage As String, DocToAttach As String)
Const UserName = "myusername"
Const UserPassword = "mypassword"
'*====================================================
'*Open e-mail session
'*====================================================
With MAPISess
.UserName = UserName
.Password = UserPassword
.NewSession = False
.LogonUI = True
.SignOn
End With
'*====================================================
'*Send message
'*====================================================
With MAPIMess
.MsgIndex = -1
.SessionID = MAPISess.SessionID
.RecipDisplayName = ToName
.RecipAddress = ToEMailAddress
.MsgSubject = "Soil Analysis"
.MsgNoteText = ThisMessage
' If nothing to attach, leave out the following line
' else set DocToAttach to full pathname of file
.AttachmentPathName = DocToAttach
.Send False
End With
'*====================================================
'*End e-mail session
'*====================================================
DoEvents
MAPISess.SignOff
End Sub
Roy Vinyard
-
Jul 31st, 2002, 03:14 PM
#8
New Member
OK. Thanks a lot. That helps.
One more question.
I don't have much VB experience, though I'm trying to get more. Could I do something similar with vbScript--even something as simple as sending a hard-coded message to a hard-coded recipient? No doubt I could add functionality from there.
Thanks for the help so far and any more you can give.
patrickhenry
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|