CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 12 of 12
  1. #1
    Join Date
    Oct 2002
    Location
    Serbia & Montenegro
    Posts
    64

    Question Microsoft Oulook

    Hi,

    I have a problem with sending mail via Microsoft Outlook. When I click Send button my app sends mail to recipient, but e-mail have been stuck in Outlook's Outbox. When I click on Send&Receive, in Outlook, e-mail will be send to recipent's address. Can I avoid that process? I would have to send mail automatically from my app without pressing on Send&Receive button in Outlook.

    Regards,
    Jovan
    Option Explicit

  2. #2
    Join Date
    Jun 2002
    Location
    Clane, Ireland
    Posts
    766
    There have been quite a few postings here re VB and Outlook, so you may find something here.

    Have you looked at CDO?
    JP

    Please remember to rate all postings.

  3. #3
    Join Date
    Oct 2003
    Location
    .NET2.0 / VS2005 Developer
    Posts
    7,104
    jp140768; please do not make useless postings such as the one above.. if you cannot propose a solution, then saying "the solution is probably here somewhere" is not appropriate. this forum does not need a bellhop or welcomer, thanks..
    "it's a fax from your dog, Mr Dansworth. It looks like your cat" - Gary Larson...DW1: Data Walkthroughs 1.1...DW2: Data Walkthroughs 2.0...DDS: The DataSet Designer Surface...ANO: ADO.NET2 Orientation...DAN: Deeper ADO.NET...DNU...PQ

  4. #4
    Join Date
    Mar 2001
    Location
    County Durham, England
    Posts
    238
    Hi Jovan,

    Just to check some code with you, are you using a reference to Micrsoft Outlook or are you using the MAPI Controls in VB ?

    Below is example of code I use , using the reference to the MS Oulook Library.

    Code:
    Dim ol As Outlook.Application
    Dim m_Item As Outlook.MailItem
    Set m_Item = ol.CreateItem(olMailItem)
    
    m_Item.Subject = "Email Subject"
    m_Item.Body = "This is an example Email"
    m_Item.Recipients.Add "Ken Judge"
    
    m_Item.Send
    Set m_Item= Nothing
    Set ol = Nothing
    One thing I have noticed is when I was checking this code, If I was in the Outbox and highlighted an email waiting to be sent, it would change it from being Italic to Standard, thought nothing of it, until I noticed the email was never sent until I re-clicked the Send/Receive button. Just something I noticed ....

  5. #5
    Join Date
    Apr 2003
    Posts
    322

    Re: Microsoft Oulook

    Quote Originally Posted by Judgey
    Hi Jovan,

    Just to check some code with you, are you using a reference to Micrsoft Outlook or are you using the MAPI Controls in VB ?

    Below is example of code I use , using the reference to the MS Oulook Library.

    Code:
    Dim ol As Outlook.Application
    Dim m_Item As Outlook.MailItem
    Set m_Item = ol.CreateItem(olMailItem)
    
    m_Item.Subject = "Email Subject"
    m_Item.Body = "This is an example Email"
    m_Item.Recipients.Add "Ken Judge"
    
    m_Item.Send
    Set m_Item= Nothing
    Set ol = Nothing
    One thing I have noticed is when I was checking this code, If I was in the Outbox and highlighted an email waiting to be sent, it would change it from being Italic to Standard, thought nothing of it, until I noticed the email was never sent until I re-clicked the Send/Receive button. Just something I noticed ....
    I've tried this, but when VB tried to execute this code, it doesn't know what Outlook.Application is nor the olMailItem
    I've added the Project Refernces to the Microsoft Outlook Object Library.

  6. #6
    Join Date
    Oct 2001
    Location
    Melbourne, Australia
    Posts
    576

    Re: Microsoft Oulook

    Are you using Outlook or Outlook express? If it's express, there is an option under "Tools"->"Options"->"Send"-."Send emails imediately" that you may need to check.

    I can't find the option, if it exists, in Outlook, but maybe this helps a little.

  7. #7
    Join Date
    Oct 2003
    Location
    Timisoara, Romania
    Posts
    460

    Re: Microsoft Oulook

    Here is a usefull thread in this forum:

    http://www.codeguru.com/forum/showth...hreadid=209216

    You could also check the FAQ from this forum

    notice that Outlook will still say that another application wants to send an e-mail on your behalf. If u want that gone too there is some more work to be done and requires a dll to be registered. Pls. post here if you want more details regarding this.
    Hope it helps!
    You liked it? Please show your gratitude and rate it!

    There is no 'patch' for stupidity.

  8. #8
    Join Date
    Jun 2002
    Location
    Clane, Ireland
    Posts
    766

    Re: Microsoft Oulook

    Hi VMA,

    If you know how to stop those popups I'd appreciate the information. I tried creating an add-in which would scan my mail and remove all mails from my inbox where the sender was not in a database I set up, but I kept getting messages about an application trying to access my mail / address book (don't remeber), and I had to select an amount of time to allow it for.

    I could not find a way of making my application for example a trusted application.

    Thanks for any assistance.

    JP
    JP

    Please remember to rate all postings.

  9. #9
    Join Date
    Oct 2003
    Location
    Timisoara, Romania
    Posts
    460

    Re: Microsoft Oulook

    here is a helpfull link from where I learned how Outlook Redemption works, also.
    Microsoft Outlook Forms Security Issues for Developers
    You liked it? Please show your gratitude and rate it!

    There is no 'patch' for stupidity.

  10. #10
    Join Date
    Apr 2003
    Posts
    322

    Re: Microsoft Oulook

    Quote Originally Posted by Zeb
    Are you using Outlook or Outlook express? If it's express, there is an option under "Tools"->"Options"->"Send"-."Send emails imediately" that you may need to check.

    I can't find the option, if it exists, in Outlook, but maybe this helps a little.
    I"m using the Full Outlook.

    I have Send immediately checked, but I dont think this is going to affect whether the Outlook program appears or not. Do you ?

  11. #11
    Join Date
    Sep 2004
    Posts
    11

    Re: Microsoft Oulook

    To avoid popup in outlook express i unchecked this:
    Tool, Options, Security, Warn me when other applications try to send mail as me

    Check if you have something like this in outlook

  12. #12
    Join Date
    Oct 2004
    Posts
    1

    Smile Re: Microsoft Oulook

    If you have option to send/receive every so many minutes set the emails will go then.

    Denis

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

Featured