private void Send(SendMailModel model) { var smtp = new Client(_host, _userId, _password, _port, _enableSsl); if (smtp != null) { smtp.Send( model.Name, model.From, model.To, model.Body, model.Body, model.AttachmentFilenames == null ? null : model.AttachmentFilenames.ToArray()); IDisposable dispose = smtp as IDisposable; if (dispose != null) { dispose.Dispose(); } } }
public ClientHelper AddWork(SendMailModel model) { _sendList.Add(model); return(this); }