Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
1
Question by hvilela · Aug 21, 2013 at 09:27 PM · attachmentapplication.openurl

Mailto with attachment

Application.OpenURL("mailto:?subject=test&body=test&attachment=" + filePath);

it does open the mail program, but do not include the file. Am I doing something wrong? There's any way to do that with unity?

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

2 Replies

· Add your reply
  • Sort: 
avatar image
3

Answer by ArkaneX · Aug 21, 2013 at 10:33 PM

Standard mailto protocol does not support attachments (see specification).

If I'm not wrong, attachment support was provided by Microsoft in older MS Outlook versions, but in newer versions RFC compliant protocol is implemented.

Comment
Add comment · Show 3 · 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 hvilela · Aug 21, 2013 at 11:32 PM 0
Share

Thanks for the fast answer. Do you see any alternative to create a new email in the default mail program with an atached file?

avatar image ArkaneX · Aug 22, 2013 at 12:24 AM 2
Share

It depends what you require. If you need to launch client program, so that your user mail account and his/her mail server is used, then without control over this program you can't add any attachment automatically.

If, on the other hand, you don't have to display anything and just send the message using mail account provided by you, then you should be able to add an attachment. Please take a look at answer to this question.

To include attachment, you have to add the following lines to the code from above answer:

 string attachmentPath = @"C:\somefile.txt";
 System.Net.$$anonymous$$ail.Attachment attachment = new System.Net.$$anonymous$$ail.Attachment(attachmentPath);
 mail.Attachments.Add(attachment);

There's an important issue related to the ServicePoint$$anonymous$$anager.ServerCertificateValidationCallback used in the code. Basically, it is a way of preventing the certificate errors during access to hosts via SSL. Using it is unsafe, at least in the form from linked code, so that it always return true, ignoring all errors. If you're going to play with this code, you definitely have to read about this callback.

And finally - if callback will be used, it should be initialized once, for example in Awake method of some global object.

avatar image Bloodysoft · Jul 17, 2014 at 09:59 PM 0
Share

That's only a partial example from another post. The mail.Attachments is from the $$anonymous$$ail$$anonymous$$essage class, so it won't work with the Ops question. You forgot to add the most important part. $$anonymous$$ail$$anonymous$$essage mail = new $$anonymous$$ail$$anonymous$$essage(); and use smtp not mailto:

avatar image
0

Answer by johnbrisoff236 · Oct 27, 2013 at 06:16 PM

Work with ms outlook data with the aid of .pst repair tool outlook 2007 download

Article http://www.outlook.repairtoolboxx.com/how-to-repair-outlook.html must immediately aid you

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

18 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 avatar image avatar image avatar image

Related Questions

Turn off renderer on key press 1 Answer

Application.OpenURL causing crashes on Android? 0 Answers

Visual studio can't attach to unity editor. 7 Answers

Application.OpenURL not working in tvOS? 1 Answer

Callback for debugger attached state change (like EditorApplication.playModeStateChanged)? 0 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