Example #1
0
        // TODO: Handle sending mail from auctions to users upon auction end
        // TODO: Handle sending mail from GMs to replace missing items

        private void SendMail(MailParameters parameters, IEnumerable <Item> items)
        {
            var mail = new MailItem(parameters);

            uint index = 0;

            foreach (Item item in items)
            {
                var attachment = new MailAttachment(mail.Id, index++, item);
                mail.AttachmentAdd(attachment);
            }

            // NOTE: outgoing mail is flushed on character save to prevent any issues,
            // this means that instant mail could take up to 60 seconds (by default) to actually arrive
            outgoingMail.Enqueue(mail);
        }