in reply to Re^3: sendmail working for me but not another
in thread sendmail working for me but not another

See Mojolicious::Guides::Tutorial for getting started.
Thanks, I will definitely check mojo out. My script is legacy, at least this is a good opportunity to learn perl, should have long time ago. I will up date my script with heredocs. I was using strict and warnings but I keep getting blank page or 404. I've been working on finding out what is causing it, but havn't been able to. I'm using use CGI::Carp qw(fatalsToBrowser warningsToBrowser); When I get rid of strict it will process with warnings, 3 variables were not initialized properly. but with strict it is just a blank screen. There is a lot of information here, i'm going to go through what everyone has given me and change my code. If I could get some kind of log, it would help but i'm still waiting on my host..

  • Comment on Re^4: sendmail working for me but not another

Replies are listed 'Best First'.
Re^5: sendmail working for me but not another
by haukex (Archbishop) on May 26, 2020 at 07:24 UTC
    I was using strict and warnings but I keep getting blank page or 404. I've been working on finding out what is causing it, but havn't been able to.

    When you add strict, you need to declare your variables with my, as in my $fstname = substr param ('first'), 0, 40; (see Use strict and warnings). Also, note that CGI scripts can be run at the command line, as in perl script.cgi 'first=John&last=Doe&...', that way you'll see any error messages the script may be giving you (you might want to disable the email sending while testing, of course).

    If I could get some kind of log, it would help but i'm still waiting on my host.

    Yes, getting access to the server logs would be helpful (see also CGI Help Guide and Troubleshooting Perl CGI scripts). With my suggestion I meant that you could add code to your script that writes the data you've received to a log file as well (because POST data won't be in the server logs anyway), that way you still have a backup of the data in case someone submits the form and the email isn't sent out. (A database would be even better, but let's take it one step at a time :-) )