Hello guys, I want to send an email with attachment from an ipad and i followed this steps: I use Application.CaptureScreenshot("screenshot.png") in Start(). For email i use this Coroutine: Code (csharp): private IEnumerator sendAutoMail (string textBody,string title) { MailMessage mail = new MailMessage(); mail.From = new MailAddress("News"); mail.To.Add("user1@gmail.com"); mail.Subject = title; mail.Body = textBody; string filename = "screenshot.png"; mail.Attachments.Add (new Attachment(Application.persistentDataPath+ "/"+ filename)); SmtpClient smtpServer = new SmtpClient("smtp.gmail.com"); smtpServer.Port = 587; smtpServer.Credentials = new System.Net.NetworkCredential("user@gmail.com", "password") as ICredentialsByHost; smtpServer.EnableSsl = true; ServicePointManager.ServerCertificateValidationCallback = delegate(object s, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return true; }; smtpServer.Send(mail); yield return null; } It is working in Editor but it si NOT working on iPad. I searched the forum and tried all the solutions, but i had no luck. If i remove the line Code (csharp): mail.Attachments.Add (new Attachment(Application.persistentDataPath+ "/"+ filename)); it is working perfect (without attachment). The problem seems to be with the path to the image, but i do not know how to solve it. I tried with Application.temporaryCachePath instead of Application.persistentDataPath, but is not working. Can you help me with?
When I try to mail attachments on iOS, I do this: http://unity3d.tutsmobile.com/mail-anything-with-unity3d/ While there's a high level API to mail images in one line, I figured the tutorial on mailing arbitrary data may be of some use to you.
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/packag...24.1112218515.1632332140-784483838.1626851333 ANDROID: https://assetstore.unity.com/packages/tools/integration/email-composer-in-android-109359