x


Sending a string via email from Unity?

Is there a way to send a predefined message from within Unity via email? What I want to do is send the information that is defined and stored as a string within Unity to a email account as soon as the game has reached the end. This is so that I can have records of the metrics I want to record. I know you can send a email from within Unity because the following link has something on this matter:

http://answers.unity3d.com/questions/63412/sending-mobile-email-via-unity.html

Can you please provide me with sample code in Javascript to explain your solution to my problem. Thank you for your help.

more ▼

asked Apr 10 '12 at 08:39 PM

randombinaries gravatar image

randombinaries
16 7 9 11

(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first
more ▼

answered Apr 10 '12 at 09:36 PM

ExTheSea gravatar image

ExTheSea
1.9k 12 22 30

Thanks for your response but what I wanted was a solution in Javascript not C#. As a majority of my game is in Javascript.

Apr 11 '12 at 07:22 PM randombinaries

Honestly Javascript propbably couldnt do it on its own but if you had an external library it might :/ The only option is to use C# as suggested by ExTheSea Hope this helps :)

Apr 11 '12 at 07:56 PM JayMHelpsU

All of .NET (or rather, Mono) is available for JS, so C# is not the only option. People seem to have a tendency to conflate .NET with C#, but they are separate things. You could try the example code and convert it to JS, though I don't know that those particular functions are actually included with Mono, or the Mono that Unity uses. It's entirely possibly that they are, but typically the more "esoteric" stuff isn't.

Apr 11 '12 at 08:02 PM Eric5h5
(comments are locked)
10|3000 characters needed characters left

Oops! Ok, just looked online and noticed I needed to include the 'using System.Net.Mail;' and the 'using http://System.Net'.

Nevermind!

However I am facing a new issue now. The game now takes ages to startup, and eventually comes up with an error saying:


SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP, Boolean requireSocketPolicy) System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) System.Net.Sockets.TcpClient.Connect (System.Net.IPEndPoint remote_end_point) System.Net.Sockets.TcpClient.Connect (System.Net.IPAddress[] ipAddresses, Int32 port) Rethrow as SmtpException: Message could not be sent. System.Net.Mail.SmtpClient.Send (System.Net.Mail.MailMessage message) Email.SendEmail () (at Assets/Standard Assets/Email.cs:48)


any ideas?

more ▼

answered Jun 20 '12 at 10:19 AM

xandermacleod gravatar image

xandermacleod
87 1 2 4

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

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

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3721
x3444
x839
x418
x50

asked: Apr 10 '12 at 08:39 PM

Seen: 968 times

Last Updated: Jun 20 '12 at 10:19 AM