Outlook Sender Permission Quandry (1 Viewer)

Minty

AWF VIP
Local time
Today, 05:25
Joined
Jul 26, 2013
Messages
10,355
Hi All,

I have a strange situation that I can't seem to solve. We have staff that generate invoices in an access database that are emailed to end customers.

We would like to send these from the accounts dept email, but the staff concerned only have SentAs permission in Exchange, not permission to access the email account itself.

Lots of reading has led me to try the code below but we are still getting bounce backs with
None of your email accounts could send to this recipient.
As the error message.
The code (important bit) is here;
Code:
 Set olApp = CreateObject("Outlook.Application")
        Set ouNamespace = olApp.GetNamespace("MAPI")
        Set olMail = olApp.CreateItem(0)
        
        With olMail
            .To = sEmailAddr
            .Subject = sEmSubject
'            .Body = sEmBody
            .HTMLBody = sHTMLEmBody & sHTMLEmSigntr
'            .ReplyRecipients.Remove 1
'            .ReplyRecipients.Add = "accounts@mycompany.com"
            .SentOnBehalfOfName = "accounts@mycompany.com"
            .Attachments.Add sEmAttachPath
            Select Case nAction
                Case 1: ' save in Drafts folder
                    .Save
                Case 2:  ' Send immediately
                    .Send
            End Select
        End With
By all reasonable googling I have tried the
.SentOnBehalfOfName = "accounts@mycompany.com"
should work.

But it don't :rolleyes: Any reasonable suggestions entertained.
I can't set From as they would need the accounts account added to their exchange account - which we don't / can't do.
 

boerbende

Ben
Local time
Today, 06:25
Joined
Feb 10, 2013
Messages
339
did you check if "accounts@mycompany.com" is a user or a distributiongroup. In the last case you will highly likely not be able to send mail
 

NauticalGent

Ignore List Poster Boy
Local time
Today, 01:25
Joined
Apr 27, 2015
Messages
6,286
Hi there Minty,

Not familiar with your setup, but I have similar issues with my Outlook setup. The antivirus will not allow me to send emails, assign tasks or anything.

I can use .display and from there I can send it from Outlook with no issues. I have looked into a dll named Redemption which is supposed to allow you to bypass this, but my IT will not entertain the idea.
 

Minty

AWF VIP
Local time
Today, 05:25
Joined
Jul 26, 2013
Messages
10,355
did you check if "accounts@mycompany.com" is a user or a distributiongroup. In the last case you will highly likely not be able to send mail

It is a shared mailbox I believe, but I'll check.

Edit - yup it's a shared Mailbox.
 
Last edited:

Minty

AWF VIP
Local time
Today, 05:25
Joined
Jul 26, 2013
Messages
10,355
Hi there Minty,

Not familiar with your setup, but I have similar issues with my Outlook setup. The antivirus will not allow me to send emails, assign tasks or anything.

I can use .display and from there I can send it from Outlook with no issues. I have looked into a dll named Redemption which is supposed to allow you to bypass this, but my IT will not entertain the idea.

Hi NG -I can send mail without issue from the users normal mail account or any other shared mail accounts that they have on their outlook profile and have access to, either directly or by using code to check the email account index and use
Code:
Set objOlAccount = OutApp.Session.accounts.Item(EmailAcctNo)
[COLOR="Green"]' Then later using[/COLOR]
.SendUsingAccount = objOlAccount
The problem appears to be that they don't have access to the mailbox its-self, but they do have SendAs permissions within Exchange.

What's really weird is if they copy the mail into a new email it still won't send. The same error message appears.

Outlook is connected to Exchange 2013, I suspect it's not even an Access issue but some obscure Exchange "thing".
 

Users who are viewing this thread

Top Bottom