|
-
Oct 17th, 2001, 08:43 AM
#1
Thread Starter
Lively Member
vb/outlook
Has anyone seen this error Trying to send e-mail
in a Vb application?
"A Program is trying to automatically send e-mail on your behalf.
Do you want to allw this?
If this is unexpected, it may be a virus and you should
choose 'NO'."
Where can I turn this error off in outlook or
can I do this in vb somehow?
Thanks for your help
-
Oct 17th, 2001, 08:49 AM
#2
Frenzied Member
I have never seen this and have used programs to send email through. If this is at work, it could possible be something your IT guys set up to avoid having viruses spread within the company. Maybe you could ask them if you feel that may be the case.
-
Oct 17th, 2001, 08:50 AM
#3
Thread Starter
Lively Member
Thats the problem...they don't have a clue
-
Oct 17th, 2001, 09:42 AM
#4
Addicted Member
It is the security in outlook. To avoid worm-virusses. You should set the security-settings of outlook to a lower level. Placed under "Zone-settings", I think.
Good luck!
-
Oct 17th, 2001, 09:56 AM
#5
Thread Starter
Lively Member
Thats what I thought, but they have locked that down so
I cant change it.
I'm trying to use
sendkeys but it gives the focus to the dialoge box and
i can't get it to send the key.
SendKeys "{enter}", True
Any ideas on doing this?
Thanks
-
Oct 17th, 2001, 10:07 AM
#6
Addicted Member
Try using vbKeyReturn instead of "{enter}". It might solve your problem.
Besides, nice ICT department you have there.... They put the Security level high themselves, but they didn't have a clue what the message was about .... LOL
-
Oct 17th, 2001, 10:16 AM
#7
Thread Starter
Lively Member
Well i would hope they know but playing stupid
well its sending the return key to fast
...code
SendKeys vbKeyReturn , True
olMail.Send
this is the problem...grrrrr
-
Oct 17th, 2001, 10:39 AM
#8
Addicted Member
Post or email me some more of the code so I would understand the question a little better.
Email: [email protected]
Greetz
-
Oct 17th, 2001, 10:45 AM
#9
Thread Starter
Lively Member
I will just post it so others can use this as reference
if they run into the same problem......
this is outlook 2000 with a security message.
The code is being done in vb 6.0.
Dim olApp As Outlook.Application
Set olApp = CreateObject("outlook.application")
'Logon to outlook. open or not
Dim olns As Outlook.NameSpace
Set olns = olApp.GetNamespace("mapi")
olns.Logon
'Sends mail
Dim olMail As Outlook.MailItem
Set olMail = olApp.CreateItem(olMailItem)
olMail.To = "[email protected]"
olMail.Subject = "xxxxx"
olMail.Body = "test"
SendKeys vbKeyReturn, True
olMail.Send
Set olns = Nothing
Set olMail = Nothing
Set olApp = Nothing
When the security is set to med.
A message box pops up when execting olMail.send and
the program waits for an answer. So sendkey will not work
becasue the program is waiting and will not allow nothing to be executed until the message box is answered.
Thanks
again for the help.
-
Oct 17th, 2001, 11:54 AM
#10
Thread Starter
Lively Member
So much for sendkeys:
SendKeys
Outlook does not allow access to certain dialog boxes by using the Visual Basic or Visual Basic for Applications SendKeys command. This prevents malicious programs from automatically dismissing the warning messages and circumventing the new security features.
from MS
http://support.microsoft.com/support.../Q262/7/01.ASP
-
Oct 18th, 2001, 01:50 AM
#11
Addicted Member
Then you should directly connect to the SMTP-server to send your mail. To much to explain here, how it works, but this might be a good example:
http://www.planetsourcecode.com/xq/A...s/ShowCode.htm
There are more exaples available tough...
Good luck!
-
Oct 18th, 2001, 02:39 AM
#12
Conquistador
You can't.
Because of the security problems with viruses etc. They have to inform the user that someone is sending mail ...
-
Oct 18th, 2001, 08:38 AM
#13
Frenzied Member
You should be able to use SMTP, the warning message is probably only for Outlook, just to avoid macros and such.
-
Oct 18th, 2001, 04:00 PM
#14
Thread Starter
Lively Member
Thanks for all te input.
I changed the code to use smtp and it works
just fine for what I need.
Thanks again for all the help.
-
Feb 19th, 2002, 08:34 AM
#15
New Member
I am also outlook for the same functionality but with extended features like sending mails to more than one people and formatting the text to be sent. If Somebody can help me with the formatting part, it wud b appreciated. The body of the mail wich I m sending is not received at the user's end with proper format lke Bold,Italics. Wot shud I do in order to retain the proper formatting and how shud I send it thru' Outlook 2000?
Chan
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
|