private async void Button1_Click(object sender, EventArgs e) { textBox2.Clear(); textBox3.Clear(); var progressResult = new Progress <string>(update => ProgressResultMethod(update)); var progressLog = new Progress <string>(update => ProgressLogMethod(update)); var scenario = new EmailSend(progressLog: progressLog, progressResult: progressResult, chromiumSettings: CompositionRoot.Resolve <IChromiumSettings>()); var listEmailAndPassword = new List <LoginPasswordInput>(tbMailAccounts.Lines.Length); foreach (var line in tbMailAccounts.Lines) { var loginPassword = line.Split(null); listEmailAndPassword.Add(new LoginPasswordInput { Login = loginPassword[0], Password = loginPassword[1] }); } await scenario.RunScenario(listEmailAndPassword : listEmailAndPassword, to : tbTo.Text, subject : tbSubject.Text, emailText : tbMailText.Lines); }