CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Having Issues With FormMail.PL ,Bluehost

 



Mbconsulting
Novice

Feb 22, 2017, 5:23 PM

Post #1 of 15 (4171 views)
Having Issues With FormMail.PL ,Bluehost Can't Post

Here is the form page: I am trying to move this site to Bluehost. I have included the code here and attached The FormMail.Pl File.Thanks.
http://testsite.canavansdeli.com/contact-us.htm2

I keep getting this message:
500 Server Error

A misconfiguration on the server caused a hiccup. Check the server logs, fix the problem, then try again.
URL: http://testsite.canavansdeli.com/cgi-bin/FormMail.pl

Here Is Some of the Formmail Code:Full Code is Attached. using version # NMS FormMail Version 3.14c1

Code
#!/usr/bin/perl  
#
# NMS FormMail Version 3.14c1
#

use strict;
use vars qw(
$DEBUGGING $emulate_matts_code $secure %more_config
$allow_empty_ref $max_recipients $mailprog
$encryptuser $encryptprog @referers
@allow_mail_to @recipients %recipient_alias
@valid_ENV $date_fmt $style $send_confirmation_mail
$confirmation_text $locale $charset $no_content
$double_spacing $wrap_text $wrap_style $postmaster
$address_style
);

# PROGRAM INFORMATION
# -------------------
# FormMail.pl Version 3.14c1
#
# This program is licensed in the same way as Perl
# itself. You are free to choose between the GNU Public
# License <http://www.gnu.org/licenses/gpl.html> or
# the Artistic License
# <http://www.perl.com/pub/a/language/misc/Artistic.html>
#
# For help on configuration or installation see the
# README file or the POD documentation at the end of
# this file.

# USER CONFIGURATION SECTION
# --------------------------
# Modify these to your own settings. You might have to
# contact your system administrator if you do not run
# your own web server. If the purpose of these
# parameters seems unclear, please see the README file.
#
BEGIN
{
$DEBUGGING = 1;
$emulate_matts_code= 0;
$secure = 1;
$allow_empty_ref = 1;
$max_recipients = 5;
$encryptuser = '';
$encryptprog = '';
$mailprog = '/usr/sbin/sendmail -oi -t';
$postmaster = '';
@referers = qw(testsite.canavansdeli.com);
@allow_mail_to = qw(bbraker@mbconsultingnj.co);
@recipients = (bbraker@mbconsultingnj.co);
%recipient_alias = ();
@valid_ENV = qw(REMOTE_HOST REMOTE_ADDR REMOTE_USER HTTP_USER_AGENT);
$locale = '';
$charset = 'iso-8859-1';
$date_fmt = '%A, %B %d, %Y at %H:%M:%S';
$style = '/css/nms.css';
$no_content = 0;
$double_spacing = 1;
$wrap_text = 0;
$wrap_style = 1;
$address_style = 0;
$send_confirmation_mail = 0;
$confirmation_text = <<'END_OF_CONFIRMATION';
From: you@your.com
Subject: form submission

Thank you for your form submission.

END_OF_CONFIRMATION



(This post was edited by FishMonger on Feb 22, 2017, 8:38 PM)
Attachments: FormMail.pl (80.0 KB)


FishMonger
Veteran / Moderator

Feb 22, 2017, 8:40 PM

Post #2 of 15 (4168 views)
Re: [Mbconsulting] Having Issues With FormMail.PL ,Bluehost [In reply to] Can't Post

Did you check the log as the error suggests?


Mbconsulting
Novice

Feb 23, 2017, 7:31 AM

Post #3 of 15 (4159 views)
Re: [FishMonger] Having Issues With FormMail.PL ,Bluehost [In reply to] Can't Post

Yes said error in Line 1 fixed and error on line 68 which had no code. Any ideas? I am better off just creating a new form page from scratch? I did not write this code. If so, any ideas on what I should use to create forms?


FishMonger
Veteran / Moderator

Feb 23, 2017, 8:35 AM

Post #4 of 15 (4157 views)
Re: [Mbconsulting] Having Issues With FormMail.PL ,Bluehost [In reply to] Can't Post

The line number in error messages is not always the exact line causing the problem. You sometimes need to look at each line prior to that to find the problem. In this case it appears to be line 52.

Code
@recipients        = (bbraker@mbconsultingnj.co);

It's missing the qw prior to the parens. The original script didn't have that bug, so I can only assume that it got removed by accident. The corrected line is:

Code
@recipients        = qw(bbraker@mbconsultingnj.co);


I would NOT recommend you try to write your own form mail script. The NMS script is one of the best form email scripts of it's time but it (like all cgi scripts) is outdated.


Mbconsulting
Novice

Feb 23, 2017, 11:13 AM

Post #5 of 15 (4153 views)
Re: [FishMonger] Having Issues With FormMail.PL ,Bluehost [In reply to] Can't Post

Thanks for your help. I had it working but now I get this: Any ideas?
Error: Bad or Missing Recipient
There was no recipient or an invalid recipient specified in the data sent to FormMail. Please make sure you have filled in the recipient form field with an e-mail address that has been configured in @recipients or @allow_mail_to. More information on filling in recipient/allow_mail_to form fields and variables can be found in the README file.

The recipient was: [ bbraker@mbconsulting.co ]


FishMonger
Veteran / Moderator

Feb 23, 2017, 11:50 AM

Post #6 of 15 (4150 views)
Re: [Mbconsulting] Having Issues With FormMail.PL ,Bluehost [In reply to] Can't Post


In Reply To
Thanks for your help. I had it working but now I get this: Any ideas?
Error: Bad or Missing Recipient
There was no recipient or an invalid recipient specified in the data sent to FormMail. Please make sure you have filled in the recipient form field with an e-mail address that has been configured in @recipients or @allow_mail_to. More information on filling in recipient/allow_mail_to form fields and variables can be found in the README file.

The recipient was: [ bbraker@mbconsulting.co ]


Does that mean you defined the @recipients array as:

Code
@recipients        = ();

or

Code
@recipients        = [ bbraker@mbconsulting.co ];


If you did either one of those then that would explain why you received the "Bad or Missing Recipient" error.


Mbconsulting
Novice

Feb 23, 2017, 12:04 PM

Post #7 of 15 (4148 views)
Re: [FishMonger] Having Issues With FormMail.PL ,Bluehost [In reply to] Can't Post

Used @recipients = qw(bbraker@mbconsultingnj.co);

Now seems the form is working but not getting the results emailed to bbraker@mbconsultingnj.co

Where 2 hours ago I got the results
Weird,right?
Any ideas?

Thanks and by the way using Bluehost


FishMonger
Veteran / Moderator

Feb 23, 2017, 12:47 PM

Post #8 of 15 (4144 views)
Re: [Mbconsulting] Having Issues With FormMail.PL ,Bluehost [In reply to] Can't Post

Have you checked the sendmail logs?

Is there a separate smtp server that it's routing through that you have access to and can review its log?


Mbconsulting
Novice

Feb 23, 2017, 2:52 PM

Post #9 of 15 (4140 views)
Re: [FishMonger] Having Issues With FormMail.PL ,Bluehost [In reply to] Can't Post

on the phone checking email logs. Here is the code.Can you see any errors?

Code
#!/usr/bin/perl  
#
# NMS FormMail Version 3.14c1
#

use strict;
use vars qw(
$DEBUGGING $emulate_matts_code $secure %more_config
$allow_empty_ref $max_recipients $mailprog
$encryptuser $encryptprog @referers
@allow_mail_to @recipients %recipient_alias
@valid_ENV $date_fmt $style $send_confirmation_mail
$confirmation_text $locale $charset $no_content
$double_spacing $wrap_text $wrap_style $postmaster
$address_style
);

# PROGRAM INFORMATION
# -------------------
# FormMail.pl Version 3.14c1
#
# This program is licensed in the same way as Perl
# itself. You are free to choose between the GNU Public
# License <http://www.gnu.org/licenses/gpl.html> or
# the Artistic License
# <http://www.perl.com/pub/a/language/misc/Artistic.html>
#
# For help on configuration or installation see the
# README file or the POD documentation at the end of
# this file.

# USER CONFIGURATION SECTION
# --------------------------
# Modify these to your own settings. You might have to
# contact your system administrator if you do not run
# your own web server. If the purpose of these
# parameters seems unclear, please see the README file.
#
BEGIN
{
$DEBUGGING = 1;
$emulate_matts_code= 0;
$secure = 1;
$allow_empty_ref = 1;
$max_recipients = 5;
$encryptuser = '';
$encryptprog = '';
$mailprog = '/usr/sbin/sendmail -oi -t';
$postmaster = '';
@referers = qw(testsite.canavansdeli.com);
@allow_mail_to = qw(bbraker@mbconsultingnj.co);
@recipients = qw(bbraker@mbconsultingnj.co);
%recipient_alias = ();
@valid_ENV = qw(REMOTE_HOST REMOTE_ADDR REMOTE_USER HTTP_USER_AGENT);
$locale = '';
$charset = 'iso-8859-1';
$date_fmt = '%A, %B %d, %Y at %H:%M:%S';
$style = '/css/nms.css';
$no_content = 0;
$double_spacing = 1;
$wrap_text = 0;
$wrap_style = 1;
$address_style = 0;
$send_confirmation_mail = 0;
$confirmation_text = <<'END_OF_CONFIRMATION';
From: you@your.com
Subject: form submission

Thank you for your form submission.

END_OF_CONFIRMATION



(This post was edited by FishMonger on Feb 23, 2017, 2:59 PM)


FishMonger
Veteran / Moderator

Feb 23, 2017, 3:03 PM

Post #10 of 15 (4137 views)
Re: [Mbconsulting] Having Issues With FormMail.PL ,Bluehost [In reply to] Can't Post

I don't see any errors in that code.


Mbconsulting
Novice

Feb 23, 2017, 8:40 PM

Post #11 of 15 (4132 views)
Re: [FishMonger] Having Issues With FormMail.PL ,Bluehost [In reply to] Can't Post

Great. Must be a Bluehost issue now. Thanks so much for your help. You provided great insight into the issue.


Mbconsulting
Novice

Feb 25, 2017, 10:58 AM

Post #12 of 15 (4113 views)
Re: [FishMonger] Having Issues With FormMail.PL ,Bluehost [In reply to] Can't Post

Hello, one last question I am trying to send the form to multiple recipients but second email not receiving results. I am getting results on first email. Any ideas?

#!/usr/bin/perl
#
# NMS FormMail Version 3.14c1
#

use strict;
use vars qw(
$DEBUGGING $emulate_matts_code $secure %more_config
$allow_empty_ref $max_recipients $mailprog
$encryptuser $encryptprog @referers
@allow_mail_to @recipients %recipient_alias
@valid_ENV $date_fmt $style $send_confirmation_mail
$confirmation_text $locale $charset $no_content
$double_spacing $wrap_text $wrap_style $postmaster
$address_style
);

# PROGRAM INFORMATION
# -------------------
# FormMail.pl Version 3.14c1
#
# This program is licensed in the same way as Perl
# itself. You are free to choose between the GNU Public
# License <http://www.gnu.org/licenses/gpl.html> or
# the Artistic License
# <http://www.perl.com/pub/a/language/misc/Artistic.html>
#
# For help on configuration or installation see the
# README file or the POD documentation at the end of
# this file.

# USER CONFIGURATION SECTION
# --------------------------
# Modify these to your own settings. You might have to
# contact your system administrator if you do not run
# your own web server. If the purpose of these
# parameters seems unclear, please see the README file.
#
BEGIN
{
$DEBUGGING = 1;
$emulate_matts_code= 0;
$secure = 1;
$allow_empty_ref = 1;
$max_recipients = 5;
$encryptuser = '';
$encryptprog = '';
$mailprog = '/usr/sbin/sendmail -oi -t';
$postmaster = '';
@referers = qw(testsite.canavansdeli.com);
@allow_mail_to = qw(bbraker@mbconsultingnj.co);
@recipients =qw(bbraker@mbconsultingnj.co,danny@mbconsultingnj.co);
%recipient_alias = ();
@valid_ENV = qw(REMOTE_HOST REMOTE_ADDR REMOTE_USER HTTP_USER_AGENT);
$locale = '';
$charset = 'iso-8859-1';
$date_fmt = '%A, %B %d, %Y at %H:%M:%S';
$style = '/css/nms.css';
$no_content = 0;
$double_spacing = 1;
$wrap_text = 0;
$wrap_style = 1;
$address_style = 0;
$send_confirmation_mail = 0;
$confirmation_text = <<'END_OF_CONFIRMATION';
From: you@your.com
Subject: form submission

Thank you for your form submission.

END_OF_CONFIRMATION


FishMonger
Veteran / Moderator

Feb 25, 2017, 12:11 PM

Post #13 of 15 (4111 views)
Re: [Mbconsulting] Having Issues With FormMail.PL ,Bluehost [In reply to] Can't Post

Change:

Code
@recipients =qw(bbraker@mbconsultingnj.co,danny@mbconsultingnj.co);


To:

Code
@recipients =qw(bbraker@mbconsultingnj.co danny@mbconsultingnj.co);



Mbconsulting
Novice

Feb 25, 2017, 1:05 PM

Post #14 of 15 (4109 views)
Re: [FishMonger] Having Issues With FormMail.PL ,Bluehost [In reply to] Can't Post

Thank you


Mbconsulting
Novice

Feb 27, 2017, 3:14 PM

Post #15 of 15 (4081 views)
Re: [FishMonger] One Last Error Message Having Issues With FormMail.PL ,Bluehost [In reply to] Can't Post

Thanks for your help. Sorry to bother you. Finally moved the site live. I only changed 3 lines of code Here is the Error Message:

Bad Referrer - Access Denied
The form attempting to use this script resides at http://www.scholars-discount-card.com/contact-us.htm, which is not allowed to access this program.

If you are attempting to configure FormMail to run with this form, you need to add the following to @referers, explained in detail in the README file.

Add 'www.scholars-discount-card.com' to your @referers array.

#!/usr/bin/perl
#
# NMS FormMail Version 3.14c1
#

use strict;
use vars qw(
$DEBUGGING $emulate_matts_code $secure %more_config
$allow_empty_ref $max_recipients $mailprog
$encryptuser $encryptprog @referers
@allow_mail_to @recipients %recipient_alias
@valid_ENV $date_fmt $style $send_confirmation_mail
$confirmation_text $locale $charset $no_content
$double_spacing $wrap_text $wrap_style $postmaster
$address_style
);

# PROGRAM INFORMATION
# -------------------
# FormMail.pl Version 3.14c1
#
# This program is licensed in the same way as Perl
# itself. You are free to choose between the GNU Public
# License <http://www.gnu.org/licenses/gpl.html> or
# the Artistic License
# <http://www.perl.com/pub/a/language/misc/Artistic.html>
#
# For help on configuration or installation see the
# README file or the POD documentation at the end of
# this file.

# USER CONFIGURATION SECTION
# --------------------------
# Modify these to your own settings. You might have to
# contact your system administrator if you do not run
# your own web server. If the purpose of these
# parameters seems unclear, please see the README file.
#
BEGIN
{
$DEBUGGING = 1;
$emulate_matts_code= 0;
$secure = 1;
$allow_empty_ref = 1;
$max_recipients = 5;
$encryptuser = '';
$encryptprog = '';
$mailprog = '/usr/sbin/sendmail -oi -t';
$postmaster = '';
@referers = qw(www.scholars-discount-card.com);
@allow_mail_to = qw(bbraker@mbconsultingnj.co);
@recipients = qw(bbraker@mbconsultingnj.co danny@mbconsultingnj.co);
%recipient_alias = ();
@valid_ENV = qw(REMOTE_HOST REMOTE_ADDR REMOTE_USER HTTP_USER_AGENT);
$locale = '';
$charset = 'iso-8859-1';
$date_fmt = '%A, %B %d, %Y at %H:%M:%S';
$style = '/css/nms.css';
$no_content = 0;
$double_spacing = 1;
$wrap_text = 0;
$wrap_style = 1;
$address_style = 0;
$send_confirmation_mail = 0;
$confirmation_text = <<'END_OF_CONFIRMATION';
From: you@your.com
Subject: form submission

Thank you for your form submission.

END_OF_CONFIRMATION

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives