Hi there,
Looking for some help. A macro is written in Excel VBA to send email through Outlook. I am getting an error, "A program is trying to send email on your behalf". What I am looking for is, this popup message should not popup. Email should be sent without any alert or warning. Please note that this macro will run on multiple systems where Outlook 365 is installed. In outlook 365, there are restrictions to do any changes in Outlook Trust Center settings also can't change anything in Windows registry. Also can't use CDO email method as there are restrictions to get SMTP Port details. Please help. I am using below code.
Looking for some help. A macro is written in Excel VBA to send email through Outlook. I am getting an error, "A program is trying to send email on your behalf". What I am looking for is, this popup message should not popup. Email should be sent without any alert or warning. Please note that this macro will run on multiple systems where Outlook 365 is installed. In outlook 365, there are restrictions to do any changes in Outlook Trust Center settings also can't change anything in Windows registry. Also can't use CDO email method as there are restrictions to get SMTP Port details. Please help. I am using below code.
Code:
Sub send_email()
application.displayalerts = false
dim outapp as object
Dim outmail as object
Set outapp = createobject("outlook.application")
with outmail
.To = ""
.cc = ""
.body ""
.send
End with
Set outmail = nothing
Set outapp = nothing
Application.displayalerts = True
end sub
Last edited by a moderator: