Error mailer

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

Ardito
Posts: 128
Joined: 12 Sep 2016, 11:26
Location: Italy

Error mailer

Postby Ardito » 18 Mar 2019, 15:54

Hi, I want to create a forgotten password system, when I send the email I get this error, can someone help me?

My code:

Code: Select all

Email myEmail = new SFSEmail(sender, address, "Password reset", "Token: " + token);
      SmartFoxServer.getInstance().getMailService().sendMail(myEmail);


Setting Mailer:
Activate: ON
Mail host: smtp.gmail.com
SMTP port: 465
Mail username: MyEmail@gmail.com
Mail password: MyPassword

Error:

Code: Select all

java.lang.NullPointerException
        at com.smartfoxserver.v2.entities.managers.SFSPostOffice.sendMail(SFSPostOffice.java:234)
        at com.smartfoxserver.v2.entities.managers.SFSPostOffice.sendMail(SFSPostOffice.java:206)
        at registerserver.PasswordMissingHandler.mailToken(PasswordMissingHandler.java:108)
        at registerserver.PasswordMissingHandler.handleClientRequest(PasswordMissingHandler.java:77)
        at com.smartfoxserver.v2.extensions.SFSExtension.handleClientRequest(SFSExtension.java:208)
        at com.smartfoxserver.v2.controllers.v290.ExtensionReqController.processRequest(ExtensionReqController.java:174)
        at com.smartfoxserver.v2.controllers.v290.ExtensionReqController$1.run(ExtensionReqController.java:68)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Error mailer

Postby Lapo » 18 Mar 2019, 17:57

Hi,
are you sure the address parameter passed in SFSEmail constructor is not null?

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 60 guests