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…
3 Answers
3
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
You can use the following plugin from asset store for iOS and android. Plugins are cheap and developer provides really nice support.
iOS : Email Composer in iOS | Integration | Unity Asset Store
ANDROID: Email Composer For Android | Integration | Unity Asset Store
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.
– Bunny83