Instead of using the send smtp mail message activity use the send outlook mail message and pass the file path and try. It’s working or not if it’s working then use the send outlook mail message activity.
The error message you are encountering, “Access to the path ‘C:\Users\Oprisor.Andrei\Documents\UiPath\Emails\Invoices’ is denied,” indicates that the process does not have the necessary permissions to access the specified folder and send the attachment via SMTP.
To resolve this issue, you can try the following steps:
Check Folder Permissions:
Ensure that the folder “C:\Users\Oprisor.Andrei\Documents\UiPath\Emails\Invoices” has the correct permissions set for the user account running the process. Confirm that the user account has both read and write permissions to the folder.
Run as Administrator:
If possible, try running the process as an administrator. Right-click on the UiPath Studio or UiPath Robot shortcut and select “Run as administrator.” This might give the process the necessary permissions to access the folder.
Check Anti-Virus/Firewall Settings:
Sometimes, antivirus or firewall settings can block access to certain folders. Check your antivirus and firewall settings to ensure they are not preventing access to the specified folder.
Use UNC Path:
Instead of using the absolute path “C:\Users\Oprisor.Andrei\Documents\UiPath\Emails\Invoices,” try using a Universal Naming Convention (UNC) path to the folder. For example, use “\ServerName\ShareName\FolderName” instead of “C:\Users\Oprisor.Andrei\Documents\UiPath\Emails\Invoices.” UNC paths can sometimes bypass permission issues.
Check File Locks:
Ensure that no other process or application is holding a lock on the files in the folder. File locks can prevent access, especially if the files are being actively used by another program.
Reinstall/Update UiPath:
If none of the above steps work, consider reinstalling or updating UiPath. There might be an issue with the installation that is causing the permission problem.
Test with Different Folder:
To narrow down the issue, try sending the attachment from a different folder to see if the problem persists. If it works with another folder, the issue might be specific to the “Invoices” folder.