in reply to mail with users names

What have you done to try and debug it?

My starting point would be to test it outside of the CGI environment: it is far easier to debug things that way.

I note that you have a function called sendmail, and you also import a function called sendmail, and you call sendmail(...) inside your sendmail function. Your own defined function will override the imported one, so this will lock you into infinite recursion on your own function. In a command-line environment you'd see a warning from defining a function with the same name; I suspect that in your CGI environment it is trying to show you those warnings, but it's saving them up to send to the browser and due to the infinite loop never getting to the point it actually sends them.

If your sendmail function took its inputs as arguments, and verified them, you might also have had a chance to spot something was wrong and bail out: that's a benefit of using better design.

Replies are listed 'Best First'.
Re^2: mail with users names
by frank1 (Monk) on Jan 01, 2024 at 17:44 UTC

    i tried to debug but i get no any error which has made me also get confused, even if i take the script to command line there is no error, after running the script

      You never call getready or sendmail. How do you think you kick off the mail sending?

      A reply falls below the community's threshold of quality. You may see it by logging in.
      there is no error

      Does the script exit?

      I suspect not.

      I haven't tried running your script but it looks to me like you have an infinite loop. So the script goes round and round merrily executing forever without error because it is doing what the code says it should. If the code runs but doesn't do what you want it to, that's not an error, it's a bug!