-
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
-
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.
-
Thats the problem...they don't have a clue :)
-
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!
-
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
-
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 :rolleyes:
-
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
-
Post or email me some more of the code so I would understand the question a little better.
Email: [email protected]
Greetz
-
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.
-
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
-
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!
-
You can't.
Because of the security problems with viruses etc. They have to inform the user that someone is sending mail ...
-
You should be able to use SMTP, the warning message is probably only for Outlook, just to avoid macros and such.
-
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.
-
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