sending emails working in editor but not in builded client (32bit and 64bit)

hello guys… i wanted to test the sending feedback “email” method in the build version and for a weerd reason it’s not working.

the scene have : 3 input fields and 1 button to send the feedback.
you can see it in the image : issue_0.png…

when i typed my correct real email + password. the email is sending “editor”.
you can see it in the image : issue_1.png

when i typed my correct real email + password. the email is not sending “build”.
you can see it in the image : issue_2.png

can somebody help me with this… and i dont know why it is not working in the build client.


2610558--183022--issue_1.PNG
2610558--183023--issue_2.PNG

Nice to see what you input mask looks like but it does not help to see whats going wrong with your code in any way.
Check the log file for the build application for problems.
If you do not find anything you may want to post the code that you are executing to send the mail, so that someone else then you can figure the problem out.

Could be your firewall. Perhaps Editor is whitelisted, but the Build is not?

offtopic: Are you really asking user to send you their email account passwords to “reduce spam”? Not good idea.

1 Like

oh yeah sorry “fffMalzbier” i forgot to put the code in here :S

in the script i use :

  • using UnityEngine;

  • using UnityEngine.UI;

  • using System;

  • using System.Collections;

  • using System.Net;

  • using System.Net.Mail;

  • using System.Net.Security;

  • using System.Security.Cryptography.X509Certificates;

public class new_feedback : MonoBehaviour {


    public Text error;
    public Text exceptionError;

    public InputField sender_email;
    public InputField password;
    public InputField sender_issue_body;



    public static string FROM;
    public static string TO = "user@gmail.com";
    public static string SUBJECT;
    public static string BODY;

    public void Update(){
        FROM = sender_email.text.ToString ();
        SUBJECT = "feedback from : " + sender_email.text.ToString ();
        BODY = sender_issue_body.text.ToString ();
    }

    public void SendingFeedback () {

        try {
          
            MailMessage mail = new MailMessage(FROM, TO, SUBJECT, BODY);
            SmtpClient smtpServer = new SmtpClient("smtp.gmail.com", 587);

            smtpServer.Credentials = new System.Net.NetworkCredential(sender_email.text.ToString(), password.text.ToString()) as ICredentialsByHost;
            smtpServer.UseDefaultCredentials = false;

            smtpServer.DeliveryMethod = SmtpDeliveryMethod.Network;

            smtpServer.EnableSsl = true;

            ServicePointManager.ServerCertificateValidationCallback = delegate(object s, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) {
                return true;
            };

            error.text = "succesfully sended the feedback!";

            smtpServer.Send(mail);
        }

        catch(Exception ex){
            error.text = "you typed your email or password wrong.";
            Debug.Log(ex);
        }

    }
}

i know it’s not a good idea… but the problem is so far… i could not send a email without password… i know it’s a weerd idea but it’s the only way to send emails.

edit : i turned off my firewall for a second… to try it out… but still not working :frowning:

The normal way to handle this would be to send a request with the answer email adress of the user and the massage to your web server , that web server then creates a mail to you with the email address and massage of the user in the text of the mail.

If im the user of your app i would NEVER EVER enter my mail password.

i know that people that would not enter the password… but i dont know how i can make a smtp server… but i dont have also the money to host it… but im not familar with this sort of things.

but actually the topic is actually “sending emails working in editor but not in builded client (32bit and 64bit)”

and the problem is… the script is working in the editor… it is sending emails… but it’s not sending if i build the project and run it…