The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/printthread.php 16 require_once



UserSpice
first verify Email send with register do not work - Printable Version

+- UserSpice (https://userspice.com/forums)
+-- Forum: Support Center (https://userspice.com/forums/forumdisplay.php?fid=23)
+--- Forum: UserSpice 4.3 and Below (https://userspice.com/forums/forumdisplay.php?fid=26)
+--- Thread: first verify Email send with register do not work (/showthread.php?tid=1126)



first verify Email send with register do not work - SirAirHard - 08-28-2018

Hello Smile
i have tryed tu report a bug, but it doesn´t work...

i have a problem with the verification email.

if a user registers the system sends an verfy email and he gets an error and is asked to send another verify Email.
and this email gets verifyed.

i had a look at the code and i can´t realy find a differenc...

thanks for your help


RE: first verify Email send with register do not work - weetax - 08-29-2018

(08-28-2018, 01:47 PM)SirAirHard Wrote: Hello Smile
i have tryed tu report a bug, but it doesn´t work...

i have a problem with the verification email.

if a user registers the system sends an verfy email and he gets an error and is asked to send another verify Email.
and this email gets verifyed.

i had a look at the code and i can´t realy find a differenc...

thanks for your help

Can you edit /users/helpers/helpers.php find the function "function email($to,$subject,$body,$opts=[],$attachment=false){"
and add this code 
Code:
$mail->SMTPOptions = array(
                           'ssl' => array(
                           'verify_peer' => false,
                           'verify_peer_name' => false,
                           'allow_self_signed' => true
                           )
                       );
 It's perfect for me. Have a good luck.


RE: first verify Email send with register do not work - SirAirHard - 08-29-2018

(08-29-2018, 04:11 AM)weetax Wrote: Can you edit /users/helpers/helpers.php find the function "function email($to,$subject,$body,$opts=[],$attachment=false){"
and add this code 
Code:
$mail->SMTPOptions = array(
                           'ssl' => array(
                           'verify_peer' => false,
                           'verify_peer_name' => false,
                           'allow_self_signed' => true
                           )
                       );
 It's perfect for me. Have a good luck.

Thanks for your quick reply.

i have tryed it but it did not work
my code looks like this now:
Code:
function email($to,$subject,$body,$opts=[],$attachment=false){
/*you can now pass in
$opts = array(
 'email' => 'from_email@aol.com',
 'name'  => 'Bob Smith'
);
*/
    $db = DB::getInstance();
    $query = $db->query("SELECT * FROM email");
    $results = $query->first();

    $mail = new PHPMailer;
       $mail->SMTPOptions = array(
                          'ssl' => array(
                          'verify_peer' => false,
                          'verify_peer_name' => false,
                          'allow_self_signed' => true
                          )
                      );
    $mail->SMTPDebug = $results->debug_level;
and i get this on my homepage:
Quote:We were unable to verify your account. Please try again.
(and a button that says: Resend Verification Email)

is it maybe becouse i have https now?


RE: first verify Email send with register do not work - Brandin - 08-29-2018

The problem is related to the last_verify column in the database. We set this to timestamp, which means most databases are updating this on every action. If the user logs in, or is modified before they verify, it renders the verification URL invalid. The fix for it is running the following SQL:
ALTER TABLE users DROP COLUMN vericode_expiry;
ALTER TABLE users ADD COLUMN vericode_expiry datetime;

Thank you,
Brandin.


RE: first verify Email send with register do not work - SirAirHard - 08-29-2018

Thanks for your quick answer that fixed the Problem
I love this software =)