Beispiel #1
0
        private void SendMailWithAttachment()
        {
            // Create composer
            MailShareComposer _composer = new MailShareComposer();

            _composer.Subject       = m_mailSubject;
            _composer.Body          = m_plainMailBody;
            _composer.IsHTMLBody    = false;
            _composer.ToRecipients  = m_mailToRecipients;
            _composer.CCRecipients  = m_mailCCRecipients;
            _composer.BCCRecipients = m_mailBCCRecipients;
            _composer.AddAttachmentAtPath(GetImageFullPath(), MIMEType.kPNG);

            // Show share view
            NPBinding.Sharing.ShowView(_composer, FinishedSharing);
        }
Beispiel #2
0
        public override void OnEnter()
        {
#if USES_SHARING
            // Create composer
            MailShareComposer _composer = new MailShareComposer();
            _composer.Subject       = subject.Value;
            _composer.Body          = body.Value;
            _composer.IsHTMLBody    = isHtmlBody.Value;
            _composer.ToRecipients  = toRecipients.IsNone ? null : toRecipients.Value.Split(';');
            _composer.CCRecipients  = ccRecipients.IsNone ? null : ccRecipients.Value.Split(';');
            _composer.BCCRecipients = bccRecipients.IsNone ? null : bccRecipients.Value.Split(';');

            // Add attachments
            if (attachmentOption != eAttachmentOption.None)
            {
                switch (attachmentOption)
                {
                case eAttachmentOption.AttachScreenshot:
                    _composer.AttachScreenShot();
                    break;

                case eAttachmentOption.AttachImage:
                    _composer.AttachImage((Texture2D)image.Value);
                    break;

                case eAttachmentOption.AttachFileAtPath:
                    _composer.AddAttachmentAtPath(filePath.Value, mimeType.Value);
                    break;

                default:
                    Log("[Sharing] Unhandled option.");
                    break;
                }
            }

            // Show share view
            NPBinding.Sharing.ShowView(_composer, FinishedSharing);
#endif
        }