ZennoPoster.BulkMailDownload System.Exception save to variable

qlwik

Client
Регистрация
03.04.2013
Сообщения
207
Благодарностей
5
Баллы
18
Hi,
I'm using ZennoPoster.BulkMailDownload and it works just fine, but sometimes there is problem with connecting to smtp and I got System.Exception:

Zrzut ekranu z 2023-08-26 17-35-43.png


Problem is, that C# go to good end instead of bad one, so I don't know if connection to smtp was good or not.

Question, how can I save this message to variable?

I tried this with no success:

C#:
try
    {
Tuple<string, string, string, string>[] allMails;
allMails = ZennoPoster.BulkMailDownload(project.Variables["mailadress"].Value,
       project.Variables["pass"].Value, project.Variables["mailserver"].Value, int.Parse(project.Variables["port"].Value), bool.Parse(project.Variables["ssl"].Value),
       ZennoLab.InterfacesLibrary.Enums.Email.EmailProtocol.IMAP,
       24*100, 10000, false, proxyString: project.Variables["proxy"].Value );

    
// loop fo all messages
foreach(Tuple<string, string, string, string> tuple in allMails)
    {
    // adding messages to the table called Tabl1
    // tuple.Item1 - subject, tuple.Item2 - from, tuple.Item3 - html message, tuple.Item4 - text message
      List<string> tmp = new List<string>();
       tmp.Add(tuple.Item1);
       tmp.Add(tuple.Item2);
       tmp.Add(tuple.Item3);
       tmp.Add(tuple.Item4);
       project.Tables["Tabl1"].AddRow(tmp);
    }

   }
     catch(Exception ex)
{
     string details = ex.ToString();
     project.Variables["details"].Value = details;
}
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)