Results 1 to 15 of 15

Thread: vb/outlook

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Posts
    69

    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

  2. #2
    Frenzied Member seoptimizer2001's Avatar
    Join Date
    Apr 2001
    Location
    Toledo, Ohio USA GMT -5
    Posts
    1,075
    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.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Posts
    69
    Thats the problem...they don't have a clue

  4. #4
    Addicted Member morphman2000's Avatar
    Join Date
    Oct 2000
    Location
    Europe, The Netherlands
    Posts
    254
    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!

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Posts
    69
    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

  6. #6
    Addicted Member morphman2000's Avatar
    Join Date
    Oct 2000
    Location
    Europe, The Netherlands
    Posts
    254
    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

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Posts
    69
    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

  8. #8
    Addicted Member morphman2000's Avatar
    Join Date
    Oct 2000
    Location
    Europe, The Netherlands
    Posts
    254
    Post or email me some more of the code so I would understand the question a little better.

    Email: [email protected]

    Greetz

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Posts
    69
    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.

  10. #10

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Posts
    69
    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

  11. #11
    Addicted Member morphman2000's Avatar
    Join Date
    Oct 2000
    Location
    Europe, The Netherlands
    Posts
    254
    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!

  12. #12
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527

    Exclamation

    You can't.

    Because of the security problems with viruses etc. They have to inform the user that someone is sending mail ...

  13. #13
    Frenzied Member seoptimizer2001's Avatar
    Join Date
    Apr 2001
    Location
    Toledo, Ohio USA GMT -5
    Posts
    1,075
    You should be able to use SMTP, the warning message is probably only for Outlook, just to avoid macros and such.

  14. #14

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Posts
    69
    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.

  15. #15
    New Member
    Join Date
    Feb 2002
    Posts
    5

    Smile

    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
  •  



Click Here to Expand Forum to Full Width