Sending Emails In Unity (Telemetry)

  Рет қаралды 8,910

Matthew Ventures

Matthew Ventures

Күн бұрын

Have you ever wanted to send emails from your Unity Indie Game? This tutorial covers two ways including direct emails, through the C# .Net, and forwarding the message through a server-hosted php script.​
Text version: www.mrventures....
0:52 - Motivation
2:37 - Method 1
6:50 - Method 2

Пікірлер: 70
@matthewventures
@matthewventures 3 жыл бұрын
Hey it's me, from the FUTURE! I would no longer recommend these methods expect in one special case where you do not want to show the user that you're sending an email (secret email). If it's okay to show the user the email, and allow them to send it from their personal address, I would advise an alternative approach: pastebin.com/EKHsvWNQ
@matthewventures
@matthewventures Жыл бұрын
Hey its me again! From the future future. Here is the new new way to send emails in unity: kzbin.info/www/bejne/bqrWiZl7jJVlnKs
@thesinisterdistrictpodcast
@thesinisterdistrictpodcast 5 жыл бұрын
your back round looks so good
@matthewventures
@matthewventures 5 жыл бұрын
Thanks I wanted it to look cool!
@pandacatplayz
@pandacatplayz 4 жыл бұрын
I had a problem with logging in but you have to go into your google account and turn on less secure apps
@pabloescargot7028
@pabloescargot7028 3 жыл бұрын
Thanks, you handsome man
@argarevata642
@argarevata642 3 жыл бұрын
Great Video Thankyou so much
@sebastien4507
@sebastien4507 2 жыл бұрын
Thanks man, really helpful!
@colorado34070
@colorado34070 2 жыл бұрын
Great video thanks
@lukedraper6313
@lukedraper6313 4 жыл бұрын
Brilliant. Thanks so much mate
@danielmmjimenez9029
@danielmmjimenez9029 2 жыл бұрын
OMG Thanks a Lot
@karlschanzl
@karlschanzl 4 жыл бұрын
Great... THX
@scottmulligan8965
@scottmulligan8965 5 жыл бұрын
Great video!
@vikes5540
@vikes5540 4 жыл бұрын
Thank u.. Helped a lot
@jorgemahamudgalan2144
@jorgemahamudgalan2144 3 жыл бұрын
Hi, I wanted to ask you, why can't I in the GameObject script, in the TxtData select the inputField txtData?
@matthewventures
@matthewventures 3 жыл бұрын
I'm not sure what you mean. You can edit an input field's text from a script
@thesinisterdistrictpodcast
@thesinisterdistrictpodcast 5 жыл бұрын
so good
@AlejandroGM96
@AlejandroGM96 4 жыл бұрын
thanks!
@abdullahcnar2864
@abdullahcnar2864 5 жыл бұрын
it wasn't work on mobile device :/
@afterlife1578
@afterlife1578 3 жыл бұрын
when I press the button, the game lags and it takes a while, is it possible to show some loading animation so that the user can know its sending?
@matthewventures
@matthewventures 3 жыл бұрын
Hmmm I haven't done a loading screen tutorial but it's a good idea. You'll have to Google it for now.
@afterlife1578
@afterlife1578 3 жыл бұрын
@@matthewventures okay thanks!
@queriesask1765
@queriesask1765 3 жыл бұрын
Hi, Thank you so much for the tutorial. I have followed your tutorial to send an email without the PHP script for my Unity Pc application. I am getting the following exception while sending email request : SmtpException: Server does not support secure connections. I have enabled Less secure app access permission in my Gmail settings. Can you please provide a solution for this exception. Thank you.
@matthewventures
@matthewventures 3 жыл бұрын
I do not have a work around. Please checkout the description link which discusses alternatives to gmail
@fredrikmagnusson1153
@fredrikmagnusson1153 2 жыл бұрын
Great video, any idea how to send email with an attachment?
@matthewventures
@matthewventures 2 жыл бұрын
You can't on phones, need to use the "share" feature.
@yehiawaleed
@yehiawaleed 3 жыл бұрын
How do you make it send log data
@dan-gu1ty
@dan-gu1ty 4 жыл бұрын
Is there any way we can attach an audio file to the email which is recorded using Unity?
@matthewventures
@matthewventures 4 жыл бұрын
Unfortunately not. Attaching files is an operating system privilege which we do not have access to. However we can use native "Sharing" tools that will then prompt the user to email, text, etc. a certain file. Google "Native Share Unity" for approaches on that one. Alternatively, you can serialize data into the email as text that can later be extracted by some means.
@pablomansilla2497
@pablomansilla2497 3 жыл бұрын
is it possible to do the same thing but using firebase instead of 000webhost?
@matthewventures
@matthewventures 3 жыл бұрын
Yeah totally, I just chose that one because it's free to set up. There's probably a ton of alternative options many of which are probably free as well
@danielcorzo7498
@danielcorzo7498 2 жыл бұрын
Hi, great tutorial! Can you do a video on Authentication? Something like OAuth? I want the users to be able to send emails with their accounts from my app.
@matthewventures
@matthewventures 2 жыл бұрын
I think for something fancy you would need, to implement a third-party authentication system. But you could use this system to email them a code that they have to type in
@danielcorzo7498
@danielcorzo7498 2 жыл бұрын
​@@matthewventures Thanks for your prompt answer! Is there any third party authentication tool you would suggest me?
@parsec3d
@parsec3d 4 жыл бұрын
Works! now,what would need to do to add an image attachment?
@matthewventures
@matthewventures 4 жыл бұрын
not possible to my understanding, do you know an app that does that?
@pedrocardenas5565
@pedrocardenas5565 3 жыл бұрын
@@matthewventures I do that with a Unity windows app Attachment att0 = new Attachment(Application.dataPath + "/../ChefUnitsAppScreenshots/" + DataStorage.userFirstName + "-" + DataStorage.userLastName + "-RightView_truckID_" + (DataStorage.truckIndex + 1) + ".png"); mail.Attachments.Add(att0);
@JacobChrist
@JacobChrist 4 жыл бұрын
Nice tat, very nerdy.
@andrewthedev2108
@andrewthedev2108 4 жыл бұрын
Hey I keep getting stuck with "Trying to send" from the php script and my email will not send using the server approach. Can anyone please help with this?
@andrewthedev2108
@andrewthedev2108 4 жыл бұрын
it keeps saying "WWW Success!: Trying to send..." but no email is ever sent, I check my spam and nothing happens.
@matthewventures
@matthewventures 4 жыл бұрын
I'm sorry I am not sure. Maybe try using a different kind of email.
@Luisfmp
@Luisfmp 8 ай бұрын
It doesnt work for webgl, right?
@matthewventures
@matthewventures 8 ай бұрын
Sorry, I can't remember
@iaderesel
@iaderesel 3 жыл бұрын
Thanks for the tutorial! I used this for my WebGL game and all worked fine for a few weeks, but now suddenly has stopped delivering mails. I have tried using the php script from a different server and I have tried using a second gmail address, but that didn't help. Do you have any ideas what may have caused the method to stop working after it worked initially?
@matthewventures
@matthewventures 3 жыл бұрын
I'm sorry, I'm not sure. Emails can be extremely finicky and the spam systems are hard to predict. These are the best methods I know of to code your own solution, Beyond this I would try integrating a third-party service of which I'm sure there's a few
@iaderesel
@iaderesel 3 жыл бұрын
@@matthewventures Ok thanks for your message! I find the email approach very nice, but would you say that if I want to be really really sure that my message arrives it may be best to store it directly on a server?
@hugoperez9959
@hugoperez9959 5 жыл бұрын
great your video!, a question: How can I do to include a capture of the game in the mail? Greetings and thanks
@matthewventures
@matthewventures 5 жыл бұрын
Hey thanks for watching! Do you mean a screen capture (like a picture of the game)? Or do you mean data from the logs?
@hugoperez9959
@hugoperez9959 5 жыл бұрын
@@matthewventures Screen capture the game :)
@matthewventures
@matthewventures 4 жыл бұрын
Hey I just finished this tutorial for you. I explain the easy way docs.unity3d.com/ScriptReference/ScreenCapture.CaptureScreenshot.html and then do my best to explain the much more complicated way NSAIntern works kzbin.info/www/bejne/mWbYpHqvZ96Zi6M Thank you for a great question!
@collectionmaterials7277
@collectionmaterials7277 3 жыл бұрын
Make more video about firebase auth fb in unity
@matthewventures
@matthewventures 3 жыл бұрын
Can you tell me a little bit more about that? I believe firebase is a data storage solution, I think it's Microsofts. Facebook is of course a social network which can be used for Auth. Are you looking for separate vids or do they relate in some way I'm not seeing?
@pandacatplayz
@pandacatplayz 4 жыл бұрын
The first method says my credentials are wrong even with the correct email and password and the second says it sent but never went through the website help me please
@matthewventures
@matthewventures 4 жыл бұрын
I'm not sure what caused that, I'm sorry.
@pandacatplayz
@pandacatplayz 4 жыл бұрын
@@matthewventures my code for the first method using UnityEngine; using UnityEngine.UI; using System.Net; using System.Net.Mail; using System.Net.Security; using System.Security.Cryptography.X509Certificates; using System.Collections; using System.Collections.Generic; public class EmailVerification : MonoBehaviour { //Email const string kSenderEmailAddress = "myemail@gmail.com"; const string kSenderPassword = "*******"; //EmailCode public EmailCode codeGenerator; //OtherScriptsStrings public string Email; public string verificationCode; public void SendMessage() { MailMessage mail = new MailMessage(); mail.From = new MailAddress( kSenderEmailAddress ); mail.To.Add( Email ); mail.Subject = "Test Email Title"; mail.Body = verificationCode; SmtpClient smtpServer = new SmtpClient("smtp.gmail.com"); smtpServer.Port = 587; smtpServer.Credentials = new NetworkCredential(kSenderEmailAddress, kSenderPassword ) as ICredentialsByHost; smtpServer.EnableSsl = true; ServicePointManager.ServerCertificateValidationCallback = delegate ( object s, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors ) { Debug.Log( "Email success!" ); return true; }; try { smtpServer.Send(mail); } catch (System.Exception e) { Debug.Log("Email Error: " + e.Message); } finally { Debug.Log("Email Sent!"); } } public IEnumerator SetMessage() { yield return new WaitForSeconds(0.1f); verificationCode = codeGenerator.emailCode; } }
@TheManCowBear
@TheManCowBear Жыл бұрын
Method 1 don't work any longer, Google won't let you do this anymore
@TheManCowBear
@TheManCowBear Жыл бұрын
To help keep your account secure, from May 30, 2022, ​​Google no longer supports the use of third-party apps or devices which ask you to sign in to your Google Account using only your username and password.
@matthewventures
@matthewventures Жыл бұрын
Correct. To my dismay! Here's the new method: kzbin.info/www/bejne/bqrWiZl7jJVlnKs
@TheManCowBear
@TheManCowBear Жыл бұрын
@@matthewventures Ahhh nice! going to watch your new film now :) good jobb and thanks!
@jairoguillen4811
@jairoguillen4811 4 жыл бұрын
How can I solve this problem? I block emails and they don't reach me, can you help me? Email error: 535-5.7.8 Username and Password not accepted. Learn more at 535 5.7.8 support.google.com/mail/?p=BadCredentials d13sm2518121wrc.64 - gsmtp
@VeganRashad
@VeganRashad 4 жыл бұрын
Thank you! Do you freelance?
@matthewventures
@matthewventures 4 жыл бұрын
It depends, email me matthewXVentures@gmail.com
@pandacatplayz
@pandacatplayz 4 жыл бұрын
help i have no view button for method 2 !!!
@matthewventures
@matthewventures 4 жыл бұрын
I'm sorry I don't understand the problem
@pandacatplayz
@pandacatplayz 4 жыл бұрын
@@matthewventures I found a way to open it but the emails aren't sending
@aditsipen5766
@aditsipen5766 2 жыл бұрын
Saya dijanjin dapet 10 dolar tp udah 1 Minggu GK dapet2.bohong apa gak nihh
@aditsipen5766
@aditsipen5766 2 жыл бұрын
1 hari lagi saya di janjikan 300 dolar semongga anda tidak berbohong.kepada saya.
@azgan123
@azgan123 4 жыл бұрын
Your hairstyle looks expensive
Sending Emails in Unity - with Attachments! ( Mailkit + SMTP )
27:24
Matthew Ventures
Рет қаралды 4,5 М.
Collecting User Feedback in Unity (Google Forms & Email)
15:44
Matthew Ventures
Рет қаралды 8 М.
Nastya and balloon challenge
00:23
Nastya
Рет қаралды 54 МЛН
Will A Guitar Boat Hold My Weight?
00:20
MrBeast
Рет қаралды 196 МЛН
Остановили аттракцион из-за дочки!
00:42
Victoria Portfolio
Рет қаралды 3,1 МЛН
How to Animate Characters in Unity 3D | Animator Explained
7:51
iHeartGameDev
Рет қаралды 786 М.
How to Send an Email or Text Message in C# with Unity
16:43
wolfs cry games
Рет қаралды 15 М.
Real 10x Programmers Are SLOW To Write Code
14:51
Thriving Technologist
Рет қаралды 26 М.
Device Camera - How to - Unity 3D [Tutorial]
14:11
N3K EN
Рет қаралды 189 М.
How to Save File with Screenshot! (Save System Unity Tutorial)
16:28
Dear Game Developers, Stop Messing This Up!
22:19
Jonas Tyroller
Рет қаралды 713 М.
How to take a Screenshot in Unity
8:41
Code Monkey
Рет қаралды 104 М.
Hide your files like a hacker (5 Ways)
19:17
NetworkChuck
Рет қаралды 86 М.
Getting Started With ARFoundation in Unity (ARKit, ARCore)
31:20
The Unity Workbench
Рет қаралды 459 М.
Snapshot Tutorial: Making Image Files From Unity Cameras
29:24
Board To Bits Games
Рет қаралды 55 М.
Nastya and balloon challenge
00:23
Nastya
Рет қаралды 54 МЛН