private void Send(JArray jArray) { var count = 0; foreach (var recipient in jArray) { var emailFactory = new EmailFactory((string)recipient["email"]); var body = (string)recipient["name"]; var ascii = (int)Convert.ToChar(body.Substring(0, 1).ToLower()); if (ascii < 97 || ascii > 122) { body = body.Substring(0, 1); } emailFactory.Body = $"{body} {this.tbx_Body.Text}"; emailFactory.Subject = this.tbx_Subject.Text; emailFactory.IsBodyHtml = false; if (this.lbl_Annex.Text != "未选择附件...") { emailFactory.Attachments(this.lbl_Annex.Text); } try { emailFactory.Send(); RunInMainthread(() => { Program.SetLog(this.tbx_Schedule, $"发送成功!{(string)recipient["email"]} {++count} / {jArray.Count}"); }); } catch (Exception ex) { RunInMainthread(() => { Program.SetLog(this.tbx_Schedule, $"发送失败!{ex.Message} {(string)recipient["email"]} {++count} / {jArray.Count}"); }); } } }