- Home /
System.Net.Mail For Web Player
In my game, the player can enter text and send it as an email. In order to do this, mono develop needs to have references for system.net.mail.
using UnityEngine;
using System.Collections;
using System;
using System.Net;
using System.Net.Mail;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
On the standalone version, mono develop DOES have these references, so sending an email works.
On the web player, mono develop DOES NOT have these references, so sending an email doesn't work.
Is there any way to add these references to mono develop on a web player? If not, how would I let the player use email?
Thanks in advance
Answer by taxvi · Jan 20, 2015 at 07:53 AM
well, bad thing about web player and about browsers in general is that you are limited in a lot of ways. browsers are not allowed to send mail. the only way for a normal webpage to send a mail is to request such an action from the back-end server. however through the webpage script you can call
window.open('mailto:test@example.com');
that will allow client to open their native mail client. read Unity <-> Browser Interaction for calling webpage function from unity web player.
Ok, so ins$$anonymous$$d of sending a message directly from the game, I would have to use a link. $$anonymous$$ind of a bummer.
I imagine there is some way to send a message from Unity with a plugin, but I've heard plugins are hard to write.
If you had a scriptable backend on the webserver(PHP/ASP/whatever) you could post from the webplayer to the site to send the email.
Your answer
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
Using DLLS in a Webplayer 0 Answers
Multiple Cars not working 1 Answer
Packing Web Build from Folder 0 Answers
What is an alternative to using System.IO Stream when building for webplayer ? 3 Answers