public void SetMailTask(string mailto, string subject, string content) { EmailEntry newEntry = new EmailEntry(); newEntry.mailto = mailto; newEntry.subject = subject; newEntry.content = content; MailTaskQueue.Enqueue(newEntry); }
private void Services_Monitor() { while (true) { EmailEntry activeEntry = MailTaskQueue.Dequeue(); if (activeEntry != null) { ActiveEmailIntent.SendMail(activeEntry.mailto, activeEntry.subject, activeEntry.content); continue; } Thread.Sleep(1000); } }