A family of Microsoft relational database management systems designed for ease of use.
This is not an Access issue, but an Outlook permissions issue. You apparently don't have SendOnBehalfOf rights anymore. Talk to your email administrator.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
i have this code ... worked fine for a long time .. but now i get the error
This message could not be sent. You do not have the permission to send the message on behalf of the specified user.
__________________________________________________
Public Sub sendEmail(fileToSend As String, eMailStr As String, subjectLine As String, cop As String, copb As String, bodyStr As String, htmlbodyStr As String)
Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Set OutApp = New Outlook.Application
Set OutMail = OutApp.CreateItem(0)
With OutMail
.SentOnBehalfOfName = "******@xxx.be"
.To = eMailStr
.Subject = subjectLine
.CC = cop
.BCC = copb
.Body = bodyStr
.HTMLBody = htmlbodyStr
If fileToSend <> vbNullString Then
.Attachments.Add fileToSend
End If
.Display
End With
Set OutMail = Nothing
Set OutApp = Nothing
Exit_Here:
Exit Sub
Error_sendemail:
A family of Microsoft relational database management systems designed for ease of use.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Answer accepted by question author
This is not an Access issue, but an Outlook permissions issue. You apparently don't have SendOnBehalfOf rights anymore. Talk to your email administrator.
it works : i changed the code
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
Set .SendUsingAccount = OutApp.Session.Accounts.Item(1)
.To = eMailStr
.Subject = subjectLine
.CC = cop
.BCC = copb
.Body = bodyStr
.HTMLBody = htmlbodyStr
If fileToSend <> vbNullString Then
.Attachments.Add fileToSend
End If
.Display
End With
This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.
Comments have been turned off. Learn more
This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.
Comments have been turned off. Learn more