Mail automation: System.Net.Mail.AlternateViewCollection cannot be serialized (unattended)

Dear all,
I have a workflow where I want to get an e-mail with “get outlook mail message” from a folder in outlook and then check if there is a new mail or not.

To check for a new mail I tried different approaches:

  • trycatch with ListofMailMessage(0).To.ToString // ListofMailMessage(0).ToString

  • For each mail → Mail message → x = item.Subject.ToString → x <> “” then ok

When I run the workflow in studio it works and there is no problem. But unattended I get an error message but no protocol error message:


Thanks in advance!


Let’s try with two approaches

  1. First upgrade the mail package in your studio and give a try once

Go to studio → design tab → manage packages-> project dependencies-> upgrade mail activity

  1. Did we give a try with Exchange activity instead of outlook activity
    It’s the same way to access the mail but with few more properties been provided
    It doesn’t require even a outlook to be installed in your machine
    Here you go on what properties need to be passed in exchange activity

Cheers @PeCour

Hi @Palaniyappan,
thanks for your help.

To 1: The packages are all already the newest available.
To 2: Yes, I would like to use Outlook Integration (Sharepoint). But our organization is not ready for that yet.

I tried the following:
I copied the whole sequence into a new project (same dependencies) and there it worked. Do you know anything about that? :see_no_evil: Thanks.

I think my problem has to do with the following. But I did not find a solution yet.
Creating long running process - serialization problem - Help / Robot - UiPath Community Forum

@Palaniyappan I found the “solution”.
The problem is that one can not serialize mail objects in persistence workflows. / mailmessage.subject etc. does not work.

Hence, I separated it into two projects. One for the E-Mails with queue and one with the persistence workflow.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.