Welcome to Dream.In.Code
Become an Expert!

Join 136,879 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,702 people online right now. Registration is fast and FREE... Join Now!




FormMail help please

 
Reply to this topicStart new topic

FormMail help please, Email not recieved

slinkydonkey
4 Aug, 2008 - 06:28 AM
Post #1

New D.I.C Head
*

Joined: 31 Jul, 2008
Posts: 1

Hello All

I am trying to get my contact page working on my site I don't want to put the link here as you might say im advertising. I am using NMS FormMail which seems to work just that I never get the email after the form has been submitted so clearly the problem is to do with my sendmail path. I think it should be /usr/sbin/sendmail -oi -t but this does not work.

My host is streamline net i know my path to perl is correct as I have created a hello world page that works.

They have this help page but I dont understand it.

My script is below which is the one which isnt sending emails the one under this is streamlinenets exmaple which sends me an email...how do I get mine to work? the only differance I can see is they use a send mail path of

/usr/sbin/sendmail -froot\@pc-healer.com

but when i add this to my script the page errors! any tips ive spent ages on this blink.gif

CODE


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

use strict;
use vars qw(
  $DEBUGGING $emulate_matts_code $secure %more_config
  $allow_empty_ref $max_recipients $mailprog @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;
  $mailprog          = '/usr/sbin/sendmail -oi -t';
  $postmaster        = '';
  @referers          = qw(pc-healer.com);
  @allow_mail_to     = qw(paul@pc-healer.com);
  @recipients        = ();
  %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: paul@pc-healer.com
Subject: form submission

Thank you for your form submission.

END_OF_CONFIRMATION

# You may need to uncomment the line below and adjust the path.
# use lib './lib';

# USER CUSTOMISATION SECTION
# --------------------------
# Place any custom code here



# USER CUSTOMISATION << END >>
# ----------------------------
# (no user serviceable parts beyond here)
}







This is the CGI example script they have me and it works it looks like its written in CGI not perl ? how do I modify my script above by using the working one below?



CODE
#!/usr/bin/perl
print "Content-type: text/html \n\n ";
$from="root\@pc-healer.com";
$to="Paul\@pc-healer.com";
$subject="CGI Test Mailer Script!";
$sendmailpath="/usr/sbin/sendmail -froot\@pc-healer.com ";
open (sendmail, "| $sendmailpath -t");
print sendmail "To: $to \n";
print sendmail "From: CGI Test Mailer <$from> \n";
print sendmail "Subject: $subject\n";
print sendmail "This message demonstrates a CGI mailer script working on this domain.\n";
close (sendmail);
print "CGI Test Mailer sent to Paul\@pc-healer.com<p></p>Please check that this was received.";

User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/3/08 08:22PM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month