Exemple #1
0
 public void onEmailReceive(Email message) {
     this.messageList.Add(message);
     messageListBox.Invoke((Action)delegate {
         StringBuilder messageTitle = new StringBuilder();
         messageTitle.AppendFormat("От: {0}, Тема: {1}", message.From, message.Theme);
         messageListBox.Items.Add(messageTitle.ToString());
     });
 }
        public SendMessageForm(Transport transport, Email email = null, bool forward = false) {
            InitializeComponent();
            this.transport = transport;
            if (email != null) {
                if (forward) {
                    this.themeTextBox.Text = "Fwd: " + email.Theme;
                } else {
                    this.themeTextBox.Text = "Re: " + email.Theme;

                }
                this.messageRichTextBox.Lines = email.Content.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
            }
        }
        public ShowMessageForm(Transport transport, Email email, bool sendConfirmation = false) {
            InitializeComponent();
            this.transport = transport;
            this.email = email;

            this.themeTextBox.Text = email.Theme;
            this.recipientTextBox.Text = email.To;
            this.messageRichTextBox.Lines = email.Content.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);

            if (sendConfirmation) {
                string confirmationTheme = "Подтверждение о прочтении";
                string confirmationText = "Пользователь " + Settings.instanceOf().Email + " прочитал ваше сообщение с темой \"" + email.Theme + "\"";
                transport.SendEmail(email.From, confirmationTheme, confirmationText);
            }
        }
Exemple #4
0
        public void SendEmail(string to, string theme, string content, bool confirmation = false) {
            Email message = new Email(to, settings.Email, theme, content, confirmation);
            string emailAddress = message.To;

            if (ARPDictionary.ContainsKey(emailAddress)) {
                int receiverId = ARPDictionary[emailAddress];
                Frame frame = new Frame(settings.Id, receiverId, FrameType.MESSAGE, message);
                sendQueue.Enqueue(frame);
            }
        }