Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by superbsumit · Mar 20, 2013 at 06:17 AM · screenshotreadpixelscapturescreenshotmail

Sending email with attachment

Hi all,

I just wanted to send an email through unity with the screenshot of the screen(iPad screen) as attachment.

Currently I came across to this for emailing :

            Application.OpenURL("mailto:?subject=subject&body=bodytesting");

Also I am using ReadPixels for saving my screenshot.

So please help me here with forwarding the screenshot as attachment.

thanks in advance..

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by XienDev · Mar 20, 2013 at 07:32 AM

1) save screenshot to file:

 Application.CaptureScreenshot(Application.persistentDataPath + "\\screen.png");



2) Open url with attachment :

 Application.OpenUrl("mailto:?subject=subject&body=bodytesting&Attachment="+Application.persistentDataPath+ "\\screen.png"); 






Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image superbsumit · Mar 20, 2013 at 08:08 AM 0
Share

Hi XienDev, I tried using the above code....but XCode show me the this error while debugging.. Failed to store screen shot.... Can u tell why is this happening....?

avatar image
0

Answer by Deniz2014 · Mar 13, 2018 at 05:33 PM

a) With Unity 2017 I had to replace the obsolete Application.CaptureScreenshot with ScreenCapture.CaptureScreenshot(Application.persistentDataPath + "\\bug.png"); screenshot on pc confirmed in C:\Users\username\AppData\LocalLow\packagename\gamename With Android I used ScreenCapture.CaptureScreenshot("bug.png"); which placed the file into the package folder


b) Application.OpenUrl("mailto:?s ... opened gmail on android with subject and body but did not add the Attachment - maybe a security feature? I put several file types (zip, png, txt) in the Application.persistentDataPath to attach but none worked

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Bunny83 · Mar 14, 2018 at 11:25 PM 0
Share

If you store the image / attachment in a private folder of your application the email app of course can't access the file as only your app is allowed to write or read this folder. You have to store the image at a location where the email app can reach it. Though i never tested it.

avatar image
0

Answer by Mayank516 · Sep 22, 2021 at 06:22 PM

You can use the following plugin from asset store for iOS and android. Plugins are cheap and developer provides really nice support.

iOS : https://assetstore.unity.com/packages/tools/email-composer-in-ios-45218?_ga=2.188046824.1112218515.1632332140-784483838.1626851333

ANDROID: https://assetstore.unity.com/packages/tools/integration/email-composer-in-android-109359

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

15 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Texture.Apply() Crashes at Resolutions under 1920x1080 1 Answer

What is the bottleneck in this iphone code? 3 Answers

Screenshot is not saving to Gallery and folder 2 Answers

ReadPixels() vs Windows ScreenShot 0 Answers

Allow user to download images from game assets 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges