PHP Classes

When using wrong $smtp->user: -> arraykey-error

Recommend this page to a friend!

      SMTP E-mail sending class  >  All threads  >  When using wrong $smtp->user: ->...  >  (Un) Subscribe thread alerts  
Subject:When using wrong $smtp->user: ->...
Summary:BTW: No PHP-Error, if password is wrong!
Messages:7
Author:Jean
Date:2023-10-24 10:30:56
 

  1. When using wrong $smtp->user: ->...   Reply   Report abuse  
Picture of Jean Jean - 2023-10-24 10:30:56
Hi there,

When using wrong credentials (value in "$smtp->user" misspelled for example) for login to smtp-server, i get the following php-Error:

Warning: Undefined array key 0 in smtp.php on line 1205


(BTW: There's no PHP-Error, when password is wrong: defined error message will be generated and shown - as expected.)

Kind regards


  2. Re: When using wrong $smtp->user: ->...   Reply   Report abuse  
Picture of Jean Jean - 2023-10-24 11:34:33 - In reply to message 1 from Jean
Sorry, i was wrong!!

I receive php-warnings, even with wrong password:

Warning: Undefined property: smtp_class::$result_code in [...]/smtp.php on line 1195
Warning: Undefined array key 0 in [...]/smtp.php on line 1205

Kind regards

Jean

  3. Re: When using wrong $smtp->user: ->...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2023-10-25 06:50:04 - In reply to message 1 from Jean
Hello Jean,

Can you provide a minimal example script so I can reproduce the issue on my developer computer?

  4. Re: When using wrong $smtp->user: ->...   Reply   Report abuse  
Picture of Jean Jean - 2023-10-25 09:21:09 - In reply to message 3 from Manuel Lemos
Hola Manuel,

using your script:
test_smtp.php,v 1.21 2022/01/29 23:37:56 mlemos Exp $

provided as download.

Kind regards

  5. Re: When using wrong $smtp->user: ->...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2023-10-26 06:19:22 - In reply to message 4 from Jean
OK, can you wait until the weekend so I can have more time to check this?

  6. Re: When using wrong $smtp->user: ->...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2023-10-30 07:16:22 - In reply to message 4 from Jean
I found the strftime deprecated error. The errors I cannot reproduce.

Can you pass your version of test_smtp.php script so I can reproduce the exact conditions and fix any issues?

  7. Re: When using wrong $smtp->user: ->...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2023-11-13 03:55:21 - In reply to message 4 from Jean
Hello,

I fixed the test_smtp.php example script to avoid using strftime.

The other errors I was not able to reproduce.

I tried PHP 8.2.12 CLI. Can you tell the exact version of PHP that you are using?