Link to home
Start Free TrialLog in
Avatar of nachumiifat
nachumiifat

asked on

Outlook message


Hi

I’m writing a program in vb6 that read emails from outlook and send auto response,
Every think is working, except outlook refuses to send messages that created in my program.
(The messages Appear in the outbox, but outlook doesnt send them)

Does any one know how can change outlook security setting to enforce send.
or mabye i have a problem with the send message function :


Public Sub SendOutlookMail(subject As String, Recipient As _
                                String, Message As String)

On Error GoTo ErrorHandler
    Dim tempOutlookAp As Outlook.Application
    Set tempOutlookAp = GetObject(, "Outlook.Application")
   
    Dim oItem As Outlook.MailItem
    Set oItem = tempOutlookAp.CreateItem(olMailItem)
    '
    With oItem
       .subject = subject
       .To = Recipient
       .Body = Message
       .Send
    End With
    '
    Set oItem = Nothing
    Set tempOutlookAp = Nothing
     '
     Exit Sub
ErrorHandler:
    Debug.Print Err.Description
End Sub

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Dabas
Dabas
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
have a look at http://www.dimastr.com/redemption/faq.htm
at the answer to question #1, they have a sample at the end of the answer that might do the trick for you. note the paragraph above it for some related problems.
Avatar of CleanupPing
CleanupPing

Hi nachumiifat,
This old question (QID 20554637) needs to be finalized -- accept an answer, split points, or get a refund.  Please see http://www.cityofangels.com/Experts/Closing.htm for information and options.
This question has been classified as abandoned.  I will make a recommendation to the moderators on its resolution in a week or two.  I would appreciate any comments by the experts that would help me in making a recommendation.
It is assumed that any participant not responding to this request is no longer interested in its final deposition.

If the asker does not know how to close the question, the options are here:
https://www.experts-exchange.com/help/closing.jsp

GPrentice00
Cleanup Volunteer
GPrentice00,
Suggest Points to Dabas.
First acceptable answer

Dabas
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

 -->Accept Dabas's comment as Answer

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER

GPrentice00
Cleanup Volunteer