Send Exchange Mail

Hi, i am having following error file sending email through sent exchange mail activity.

Send Exchange Mail Message: The request failed. The underlying connection was closed: An unexpected error occurred on a send.

This error only pops up only when sending an attachment which is around 70KB. I tried with another attachment which is around 12KB. it works…
any idea how can i solve this issue?

1 Like

Hello @Robott

Normaly for Exchange you can send file up to 10mb, have you check if the send or receiver have fixed a different size limiter ?

i can upload upto 10MB while using web based version of exchange. So i wonder if this problem is caused by activity itself?

@Robott

I don’t think so, can you share workflow so i can i try on my side.

Email.xaml (4.9 KB)
please have a look…
u will have to fill the variable values with your own.
anhang & anhang1 for different size files

@Robott

So i tried on my side, it works fine with a 1.78 Mo. :point_down:

ExchangeMail.xaml (5.1 KB)

*Note data it might be some restrection from receiver or sender…

1 Like

i cannot see how you are sending an attachment, it’s empty

Just click on add and give it the path of your file :point_down:

ok, actually there is no real difference in my workflow and yours… i just wonder what causes this then

@Robott

As said before, it might that they’re some size restrictions, from receiver or sender, what kind of file are you trying to upload ? and the exact error you get ?

infact i am testing on my own email addresse. sending excel attachments
Error is

Detailed Error

20.2.0-beta.108+Branch.release-v2020.2.0.Sha.8a477a3ff8e9d37d84fd97a9b453d655d8f9dddd

Source: Throw Application Exception

Message: Error in Process.
Source: Invoke SendEmail workflow: Send Exchange Mail Message
Exception message: The request failed. The underlying connection was closed: An unexpected error occurred on a send.

Exception Type: System.Exception

RemoteException wrapping System.Exception: Error in Process.
Source: Invoke SendEmail workflow: Send Exchange Mail Message
Exception message: The request failed. The underlying connection was closed: An unexpected error occurred on a send.  ---> RemoteException wrapping Microsoft.Exchange.WebServices.Data.ServiceRequestException: The request failed. The underlying connection was closed: An unexpected error occurred on a send.  ---> RemoteException wrapping System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send.  ---> RemoteException wrapping System.IO.IOException: Unable to write data to the transport connection: Eine vorhandene Verbindung wurde vom Remotehost geschlossen.  ---> RemoteException wrapping System.Net.Sockets.SocketException: Eine vorhandene Verbindung wurde vom Remotehost geschlossen 
   at System.Net.Sockets.Socket.MultipleSend(BufferOffsetSize[] buffers, SocketFlags socketFlags)
   at System.Net.Sockets.NetworkStream.MultipleWrite(BufferOffsetSize[] buffers)
	--- End of inner exception stack trace ---
   at System.Net.Sockets.NetworkStream.MultipleWrite(BufferOffsetSize[] buffers)
   at System.Net.Security._SslStream.StartWriting(SplitWritesState splitWrite, SplitWriteAsyncProtocolRequest asyncRequest)
   at System.Net.Security._SslStream.ProcessWrite(BufferOffsetSize[] buffers, SplitWriteAsyncProtocolRequest asyncRequest)
   at System.Net.TlsStream.MultipleWrite(BufferOffsetSize[] buffers)
   at System.Net.Connection.Write(ScatterGatherBuffers writeBuffer)
   at System.Net.ConnectStream.ResubmitWrite(ConnectStream oldStream, Boolean suppressWrite)
	--- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.GetResponse()
   at Microsoft.Exchange.WebServices.Data.EwsHttpWebRequest.Microsoft.Exchange.WebServices.Data.IEwsHttpWebRequest.GetResponse() in \\REDMOND\EXCHANGE\BUILD\E15\15.00.0913.015\SOURCES\sources\dev\EwsManagedApi\src\EwsManagedApi\Core\EwsHttpWebRequest.cs:line 113
   at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.GetEwsHttpWebResponse(IEwsHttpWebRequest request) in \\REDMOND\EXCHANGE\BUILD\E15\15.00.0913.015\SOURCES\sources\dev\EwsManagedApi\src\EwsManagedApi\Core\Requests\ServiceRequestBase.cs:line 821
	--- End of inner exception stack trace ---
   at UiPath.Mail.Exchange.Activities.ExchangeScope.OnFaulted(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)
   at System.Activities.Runtime.FaultCallbackWrapper.Invoke(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)
   at System.Activities.Runtime.FaultCallbackWrapper.FaultWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at UiPath.Executor.BaseRunner.EndExecute(IAsyncResult result)
   at UiPath.Executor.InProcessRunner.EndExecute(IAsyncResult result)
   at UiPath.Core.Activities.ExecutorInvokeActivity.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
   at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
   at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at UiPath.Executor.BaseRunner.EndExecute(IAsyncResult result)
   at UiPath.Executor.InProcessRunner.EndExecute(IAsyncResult result)
   at UiPath.Core.Activities.ExecutorInvokeActivity.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
   at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
   at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
	--- End of inner exception stack trace ---
   at System.Activities.Statements.Throw.Execute(CodeActivityContext context)
   at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
   at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
   at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

@Robott

Check username and credential !

Let me know if it worked out for you :slight_smile:

credentials are correct, as i am able to send email without attachment.

@Robott

So you said, that you can send a file with more than 70ko on the web, but using the exchange activitiy you can’t right ? And you can send any email with unter than 10ko file size right ?

Just to be clear for others on the forum, if they have any idea… :slight_smile:

yes exactly, thats the problem