Advanced Print Rounting - Error message

Hi,
I wrote a simple APR-BPM to send a PO notification email to suppliers. I get the below error message. The SMTP is configured properly, and I base myself on the fact that if I use the Email Icon under the PO Print screen and I specify the email address to send to, I do receive it.
BTW - I get the same error even if I hardcode the email addrress.
Not getting meanigfull help from Epicor, as everyone tries to point the fingure at the other service provider.

Thanks

Program Ice.Services.Lib.RunTask raised an unexpected exception with the following message: RunTask: Transaction failed. The server response was: 5.2.0 STOREDRV.Submission.Exception:SendAsDeniedException.MapiExceptionSendAsDenied; Failed to process message due to a permanent exception with message Cannot submit message. 16.55847:8D110000, 17.43559:0000000094000000000000000000000000000000, 20.52176:140F1686000010100300170E, 20.50032:140F1686701710100A00FD80, 0.35180:E7020000, 255.23226:0A008440, 255.27962:0A000000, 255.27962:0E000000, 255.31418:0A000000, 16.55847:A0000000, 17.43559:00000000A0010000000000000200000000000000, 20.52176:140F16860000101003000136, 20.50032:140F1686701710100A00DA36, 0.35180:44000000, 255.23226:4800D13D, 255.27962:0A000000, 255.27962:32000000, 255.17082:DC040000, 0.27745:0A003A66, 4.21921:DC040000, 255.27962:FA000000, 255.1494:64000000, 0.38698:0F010480, 0.37692:05000100, 0.44092:05000100, 0.41232:05000100, 0.60208:05000100, 0.37136:00000000, 0.34608:302E3135, 0.55056:30303A59, 0.42768:30313031, 0.56112:32343A38, 0.52807:3437632D, 4.33016:DC040000, 7.40748:010000000000010B62656430, 7.57132:000000000000000032000000, 1.63016:32…
Stack Trace:
at System.Net.Mail.DataStopCommand.CheckResponse(SmtpStatusCode statusCode, String serverResponse)
at System.Net.Mail.DataStopCommand.Send(SmtpConnection conn)
at System.Net.ClosableStream.Close()
at System.Net.Mail.SmtpClient.Send(MailMessage message)
at Ice.Core.SsrsReporting.EmailSender.Send(EmailActionSettings settings, IEnumerable1 attachmentInfos) in C:\_Releases\ICE\ICE3.2.100.10\Source\Server\Internal\Lib\TaskLib\SsrsReporting\EmailSender.cs:line 27 at Ice.Core.RoutingAndBreaking.EmailReportAction.EmailReportsFromReportRequests() in C:\_Releases\ICE\ICE3.2.100.10\Source\Server\Internal\Lib\TaskLib\RoutingAndBreaking\EmailReportAction.cs:line 261 at Ice.Core.RoutingAndBreaking.EmailReportAction.HandleProcess(Object sender, ProcessEventArgs e) in C:\_Releases\ICE\ICE3.2.100.10\Source\Server\Internal\Lib\TaskLib\RoutingAndBreaking\EmailReportAction.cs:line 166 at System.EventHandler1.Invoke(Object sender, TEventArgs e)
at Ice.Core.RoutingAndBreaking.BaseNode.OnProcess(ProcessEventArgs e) in C:_Releases\ICE\ICE3.2.100.10\Source\Server\Internal\Lib\TaskLib\RoutingAndBreaking\BaseNode.cs:line 172
at Ice.Core.RoutingAndBreaking.BaseNode.OnProcess(ProcessEventArgs e) in C:_Releases\ICE\ICE3.2.100.10\Source\Server\Internal\Lib\TaskLib\RoutingAndBreaking\BaseNode.cs:line 172
at Ice.Core.RoutingAndBreaking.BaseNode.OnProcess(ProcessEventArgs e) in C:_Releases\ICE\ICE3.2.100.10\Source\Server\Internal\Lib\TaskLib\RoutingAndBreaking\BaseNode.cs:line 172
at Ice.Core.RoutingAndBreaking.BaseNode.OnProcess(ProcessEventArgs e) in C:_Releases\ICE\ICE3.2.100.10\Source\Server\Internal\Lib\TaskLib\RoutingAndBreaking\BaseNode.cs:line 172
at Ice.Core.RoutingAndBreaking.Workflow.OnProcess(ProcessEventArgs e) in C:_Releases\ICE\ICE3.2.100.10\Source\Server\Internal\Lib\TaskLib\RoutingAndBreaking\Workflow.cs:line 209
at Ice.Core.RoutingAndBreaking.Workflow.Run(ReportInstanceInformation reportInstance) in C:_Releases\ICE\ICE3.2.100.10\Source\Server\Internal\Lib\TaskLib\RoutingAndBreaking\Workflow.cs:line 153
at Ice.Core.RptBase.ReportSsrsDatabaseBuilder.RouteAndBreakReport(Func2 executeCommand, Func2 executeReader, SqlObjectsCreated sqlObjectsCreated) in C:_Releases\ICE\ICE3.2.100.10\Source\Server\Internal\Lib\TaskLib\RptBase\ReportSsrsDatabaseBuilder.cs:line 334
at Ice.Core.RptBase.ReportDatabaseBuilder.XMLClose() in C:_Releases\ICE\ICE3.2.100.10\Source\Server\Internal\Lib\TaskLib\RptBase\ReportDatabaseBuilder.cs:line 76
at Ice.Core.RptTaskBase1.XMLClose() in C:\_Releases\ICE\ICE3.2.100.10\Source\Server\Internal\Lib\TaskLib\RptBase\RptTaskBase.cs:line 159 at Erp.Internal.PM.POForm.RunProcess(Int64 instanceTaskNum, String outputFileName) in c:\_Releases\ERP\RL10.2.100.0\Source\Server\Internal\PM\POForm\POForm.cs:line 429 at Ice.Hosting.TaskCaller.InnerExecuteTask(IceDataContext newContext) in C:\_Releases\ICE\ICE3.2.100.10\Source\Framework\Epicor.Ice\Hosting\TaskCaller\TaskCaller.cs:line 104 at Ice.Hosting.TaskCaller.ExecuteTask() in C:\_Releases\ICE\ICE3.2.100.10\Source\Framework\Epicor.Ice\Hosting\TaskCaller\TaskCaller.cs:line 63 at Ice.Lib.RunTask.BpmFriendlyTaskLauncher.Run(String sessionIdPrefix, IceContext db, Action taskRunner) in C:\_Releases\ICE\ICE3.2.100.10\Source\Server\Services\Lib\RunTask\BpmFriendlyTaskLauncher.cs:line 63 at Ice.Services.Lib.RunTaskSvc.InnerRunTask(Int64 ipTaskNum, Boolean suppressTransaction) in C:\_Releases\ICE\ICE3.2.100.10\Source\Server\Services\Lib\RunTask\RunTask.cs:line 542 at Ice.Services.Lib.RunTaskSvc.InnerRunTask(Int64 ipTaskNum, Boolean suppressTransaction) in C:\_Releases\ICE\ICE3.2.100.10\Source\Server\Services\Lib\RunTask\RunTask.cs:line 542 at Ice.Services.Lib.RunTaskSvcFacade.RunTask(Int64 ipTaskNum) in C:\_Releases\ICE\ICE3.2.100.10\Source\Server\Services\Lib\RunTask\RunTaskSvcFacade.cs:line 138 at SyncInvokeRunTask(Object , Object[] , Object[] ) at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) at Epicor.Hosting.OperationBoundInvoker.InnerInvoke(Object instance, Func2 func) in C:_Releases\ICE\ICE3.2.100.10\Source\Framework\Epicor.System\Hosting\OperationBoundInvoker.cs:line 59
at Epicor.Hosting.OperationBoundInvoker.Invoke(Object instance, Func2 func) in C:\_Releases\ICE\ICE3.2.100.10\Source\Framework\Epicor.System\Hosting\OperationBoundInvoker.cs:line 28 at Epicor.Hosting.Wcf.EpiOperationInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) in C:\_Releases\ICE\ICE3.2.100.10\Source\Framework\Epicor.System\Hosting\Wcf\EpiOperationInvoker.cs:line 23 at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet) at System.ServiceModel.Dispatcher.ChannelHandler.DispatchAndReleasePump(RequestContext request, Boolean cleanThread, OperationContext currentOperationContext) at System.ServiceModel.Dispatcher.ChannelHandler.HandleRequest(RequestContext request, OperationContext currentOperationContext) at System.ServiceModel.Dispatcher.ChannelHandler.AsyncMessagePump(IAsyncResult result) at System.ServiceModel.Dispatcher.ChannelHandler.OnAsyncReceiveComplete(IAsyncResult result) at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result) at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously) at System.ServiceModel.Channels.SecurityChannelListener1.ReceiveItemAndVerifySecurityAsyncResult`2.InnerTryReceiveCompletedCallback(IAsyncResult result)
at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)
at System.ServiceModel.Channels.TransportDuplexSessionChannel.TryReceiveAsyncResult.OnReceive(IAsyncResult result)
at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)
at System.ServiceModel.Channels.SynchronizedMessageSource.ReceiveAsyncResult.OnReceiveComplete(Object state)
at System.ServiceModel.Channels.SessionConnectionReader.OnAsyncReadComplete(Object state)
at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
at System.Net.Security.NegotiateStream.ProcessFrameBody(Int32 readBytes, Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.NegotiateStream.ReadCallback(AsyncProtocolRequest asyncRequest)
at System.Net.AsyncProtocolRequest.CompleteRequest(Int32 result)
at System.Net.FixedSizeReader.CheckCompletionBeforeNextRead(Int32 bytes)
at System.Net.FixedSizeReader.ReadCallback(IAsyncResult transportResult)
at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)
at System.ServiceModel.Channels.ConnectionStream.IOAsyncResult.OnAsyncIOComplete(Object state)
at System.Net.Sockets.SocketAsyncEventArgs.OnCompleted(SocketAsyncEventArgs e)
at System.Net.Sockets.SocketAsyncEventArgs.FinishOperationSuccess(SocketError socketError, Int32 bytesTransferred, SocketFlags flags)
at System.Net.Sockets.SocketAsyncEventArgs.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)

We’ve been battling the same ‘SendAsDeniedException’ with O365. The email address of the account you are using to send the mail must be equal to the return email address specified in the outgoing message. Pretty sure that’s your answer.

3 Likes

Not sure if this helps or not but…

For us we use a mailrelay@blahblahblah.com Office 365 Mail Relay account to send general emails from Epicor. Our SMTP settings are set to flow through this account\server. But in my Breaking and Routing Rules for PO Confirmations I was using the actual Buyer’s email address as the “From” email and not the Mail Relay address. So I had to make sure that each Buyer was setup with a “Send As” Mail Relay in their O365 account. Once I setup the “Send As” Mail Relay for our Buyers, it worked!

If anyone can figure out way to create a group where we can set the Send As Mail Relay option so that we don’t have to set this option on an individual basis every time, that would be great!

1 Like

Bingo!!! that was the issue and it ties into the previous suggestions re: making changes to the email alias at the Office 365 level.

BTW, under the Saas (Epicor cloud) this issue does not exist.

Thanks you all very much

1 Like

Thank You Heather for taking the time to provide all the details - I am going to use that.

Very much appreciated.

1 Like

Glad to be helpful! Our solution is very similar to Heather’s. Also, be careful as some other applications do not let you control the addresses as easily. Epicor HCM is one example. We cannot get it to send directly through Office 365 no matter what we do, and support has yet to be any help.

1 Like