public void SendHTMLTextMail() { // Create composer MailShareComposer _composer = new MailShareComposer(); _composer.Subject = m_mailSubject; _composer.Body = m_htmlMailBody; _composer.IsHTMLBody = true; _composer.ToRecipients = m_mailToRecipients; _composer.CCRecipients = m_mailCCRecipients; _composer.BCCRecipients = m_mailBCCRecipients; // Show share view NPBinding.Sharing.ShowView(_composer, FinishedSharing); }
private void SendPlainTextMail() { // 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; // Show share view NPBinding.Sharing.ShowView(_composer, FinishedSharing); }
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); }
public void SendFeedbackMail() { if (NPBinding.Sharing.IsMailServiceAvailable()) { string m_mailSubject = "Feedback"; string m_plainMailBody = "\n" + "\n" + "\n" + "\n" + "DO NOT EDIT BELOW INFO" + "\n" + "Devide Name - " + SystemInfo.deviceName + "\n" + "Devide Model - " + SystemInfo.deviceModel + "\n" + "Devide Type - " + SystemInfo.deviceType + "\n" + "OS version - " + SystemInfo.operatingSystem + "\n"; string[] m_mailToRecipients = new string[] { feedbackID }; MailShareComposer _composer = new MailShareComposer(); _composer.Subject = m_mailSubject; _composer.Body = m_plainMailBody; _composer.ToRecipients = m_mailToRecipients; //_composer.CCRecipients = m_mailCCRecipients; //_composer.BCCRecipients = m_mailBCCRecipients; // Add below line if you want to attach a file, for ex : image. Else, ignore. // _composer.AddAttachmentAtPath (Application.persistentDataPath + "test.png", MIMEType.kPNG); // Show share view NPBinding.Sharing.ShowView(_composer, FinishedSharing); } }
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 }