Ejemplo n.º 1
0
        /// <summary>
        /// Shows the draft.
        /// </summary>
        /// <param name="subject">The subject.</param>
        /// <param name="body">The body.</param>
        /// <param name="html">if set to <c>true</c> [HTML].</param>
        /// <param name="to">To.</param>
        /// <param name="cc">The cc.</param>
        /// <param name="bcc">The BCC.</param>
        /// <param name="attachments">The attachments.</param>
        public void ShowDraft(string subject, string body, bool html, string[] to, string[] cc, string[] bcc, IEnumerable <string> attachments = null)
        {
            var intent = new Intent(Intent.ActionSendMultiple);

            intent.SetType(html ? "text/html" : "text/plain");
            intent.PutExtra(Intent.ExtraEmail, to);
            intent.PutExtra(Intent.ExtraCc, cc);
            intent.PutExtra(Intent.ExtraBcc, bcc);
            intent.PutExtra(Intent.ExtraSubject, subject ?? string.Empty);

            if (html)
            {
                intent.PutExtra(Intent.ExtraText, Android.Text.Html.FromHtml(body));
            }
            else
            {
                intent.PutExtra(Intent.ExtraText, body ?? string.Empty);
            }

            if (attachments != null)
            {
                intent.AddAttachments(attachments);
            }

            this.StartActivity(intent);
        }
Ejemplo n.º 2
0
        public void ShowDraft(string subject, string body, bool html, string to, IEnumerable <string> attachments)
        {
            var intent = new Intent(Intent.ActionSend);

            intent.SetType(html ? "text/html" : "text/plain");
            intent.PutExtra(Intent.ExtraEmail, to);
            intent.PutExtra(Intent.ExtraSubject, subject ?? string.Empty);

            if (html)
            {
                intent.PutExtra(Intent.ExtraText, body);
            }
            else
            {
                intent.PutExtra(Intent.ExtraText, body ?? string.Empty);
            }

            intent.AddAttachments(attachments);

            this.StartActivity(intent);
        }