Results 1 to 3 of 3
  1. #1
    tdoolittle is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Apr 2014
    Posts
    18

    SentOnBehalfOfName Not Actually Sending

    So a portion of my code contains the following:

    Code:
    Set OutApp = CreateObject("outlook.application")OutApp.Session.Logon
    Set OutMail = OutApp.CreateItem(0)
    With OutMail
        .SentOnBehalfOfName = IIf(Records![AccountName] = "MAIN", "MAIN@domain.com", "ANYTHING_ELSE@domain.com")
        .to = Records![Buyer_Email]
        .subject = Email_Subject
        .HTMLBody = Body_Format
        .Display
        .Send
    End With
          Records.MoveNext
       Loop
    Set OutMail = Nothing
    Set OutApp = Nothing
    Everything works great except for the actual sending part. If I take the auto send out I can see each email pop up, all formatted correctly and the "From" address is set correctly depending on the record source. However, I instantly get a bounce back from Outlook stating:



    "This message could not be sent. Try sending the message again later, or contact your network administrator. Error is [0x80070005-00000000-00000000]."

    Researching, I have to assume all of this is because we don't actually have an Exchange server and are simply using Outlook to organize our Gmail accounts. Looking for someone here to confirm that is my issue as this is the most reliable site I have found.

    If this is the case, does anyone know of a method I can take to ensure my messages are being sent from the correct Gmail account within Outlook?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    tdoolittle is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Apr 2014
    Posts
    18
    Had to strip it down to it's bare bones to understand it, and play with the port numbers, but I seem to be up and running! Now to get my HTML back in there

    Thanks for the help as always, June!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. New Member Sending a Hello
    By BluffMeAllIn in forum General Chat
    Replies: 4
    Last Post: 12-04-2013, 11:12 AM
  2. Sending .pdf in Outlook
    By Stephanie53 in forum Forms
    Replies: 65
    Last Post: 05-01-2013, 08:04 AM
  3. Combining 'sending mail' with 'sending a report'.
    By Mattbro in forum Programming
    Replies: 2
    Last Post: 11-25-2012, 07:42 AM
  4. Sending reports
    By nashr1928 in forum Forms
    Replies: 3
    Last Post: 04-28-2010, 07:31 AM
  5. Sending email
    By nashr1928 in forum Reports
    Replies: 8
    Last Post: 04-27-2010, 11:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums