For Programmers: Free Programming Magazines  


Home > Archive > PERL CGI Beginners > January 2006 > How to safely add BCC field in NMS FormMail?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How to safely add BCC field in NMS FormMail?
Mike H

2005-12-17, 6:55 pm

Hello,

I have almost zero experience with Perl but would truly
appreciate any help with the following.

I'm using the NMS FormMail script to include a basic web
form on my page. I would like to include a BCC field within
the NMS script to automatically send the form to a second
address. (The web user does not enter any address. It will
be hard coded into the script.)

My problem boils down to the following. I tried to remove
"-t" opton from the $postmaster variable but I get an error
when I try to submit a form. How can I remove the "-t" option
from the sendmail command in the $postmaster variable without
getting an error?

Thank you for any help.

- Mike
gratemyl@gmail.com

2006-01-10, 3:56 am


Mike H wrote:
> I'm using the NMS FormMail script to include a basic web
> form on my page. I would like to include a BCC field within
> the NMS script to automatically send the form to a second
> address. (The web user does not enter any address. It will
> be hard coded into the script.)

Fine, but please post the related code here, so anybody who reads the
post can immediately reply, without needing to look for the script
first.

> My problem boils down to the following. I tried to remove
> "-t" opton from the $postmaster variable but I get an error
> when I try to submit a form. How can I remove the "-t" option
> from the sendmail command in the $postmaster variable without
> getting an error?

Why would you do that?

> Thank you for any help.
>
> - Mike


Yours,

Gratemyl

Paul Lalli

2006-01-10, 3:56 am

Mike H wrote:
> I have almost zero experience with Perl but would truly
> appreciate any help with the following.
>
> I'm using the NMS FormMail script to include a basic web
> form on my page. I would like to include a BCC field within
> the NMS script to automatically send the form to a second
> address. (The web user does not enter any address. It will
> be hard coded into the script.)
>
> My problem boils down to the following. I tried to remove
> "-t" opton from the $postmaster variable


Why do you believe you want to do this?

> but I get an error
> when I try to submit a form.


"an error" is not especially helpful. Do you think the actual text of
the error is somehow unimportant? I'm betting it's not.

> How can I remove the "-t" option
> from the sendmail command in the $postmaster variable without
> getting an error?


Well, 1) Why do you want to do that, and 2) How can we possibly know
that without knowing what the erorr is.

As for your original question - and I do not understand the connection
between that and this -t issue - why not simply include the BCC right
in the script, as you said you wanted to?

Find the piece of code that looks like:
$self->mailer->print(<<END);
X-Mailer: ${\( $self->name_and_version )}
To: $to
From: $from
Subject: $subject
END

And replace it with:
$self->mailer->print(<<END);
X-Mailer: ${\( $self->name_and_version )}
To: $to
Bcc: joe\@example.com
From: $from
Subject: $subject
END

(or whatever address you want to BCC on every submission).

Paul Lalli

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com