Gmail error

RemoteException wrapping System.IO.IOException: The process cannot access the file ‘D:\HDC Reports\Card Returned But Out FlashMissed Report\RFID Card Returned But Out Flash Missed Report2019-10-13.pdf’ because it is being used by another process.
at System.IO.__Error.WinIOError(Int32 errorCode,
String maybeFullPath)
at System.IO.FileStream.Init(String path,
FileMode mode,
FileAccess access,
Int32 rights,
Boolean useRights,
FileShare share,
Int32 bufferSize,
FileOptions options,
String msgPath,
Boolean bFromProxy,
Boolean useLongPath,
Boolean checkHost)
at System.IO.FileStream…ctor(String path,
FileMode mode,
FileAccess access,
FileShare share)
at System.Net.Mail.AttachmentBase.SetContentFromFile(String fileName,
String mediaType)
at System.Net.Mail.AttachmentBase…ctor(String fileName)
at System.Net.Mail.Attachment…ctor(String fileName)
at UiPath.Mail.SMTP.Activities.SendMail.SendMailTask(AsyncCodeActivityContext context,
Receiver receiver,
MailMessage mailMessage,
CancellationToken cancellationToken,
Boolean isNewMessage,
String body)
at UiPath.Mail.Activities.SendMailActivity.BeginExecute(AsyncCodeActivityContext context,
AsyncCallback callback,
Object state)
at System.Activities.AsyncCodeActivity.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)

Hello @vishnumurthy

Looks like the pdf file is open in some other application. Make sure it is not used in any other application by closing them all. Then try again and see whether it works.

@vishnumurthy I guess you missed slash in the path Report\2019-10-13.pdf

Kindly use a KILL PROCESS activity before to the activity where this error occurred
And in the property panel of KILL PROCESS activity along the property ProcessName mention as “Acrobat” or ”Acrord32” (any one probably the first based on the application and to find the exact one we can find that in Task Manager under process tab where mention the name before .exe for pdf application)

This will close the pdf application before opening or processing that file so that this error won’t appear

Cheers @vishnumurthy