Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > mailing from a web-executed perl script.

Reply
Thread Tools

mailing from a web-executed perl script.

 
 
Nathan
Guest
Posts: n/a
 
      04-03-2006
This may be a basic task to some of you perl guru's, but I have a
problem getting a perl script i've written, when executed by httpd, to
send out an e-mail.

Basically, i have a few variables passed into this script, it writes
them to a a database, and then its supposed to read the "E-mail list"
attached to that database entry and shoot an e-mail off to everyone in
that list letting them know that there's been an update.
I have what would seem like all of the difficult things done! It takes
the variables, writes them to the database, reads the list (which is
currently only my e-mail address" and then sends the message. The
problem is that the message is empty!
If i execute the script at a shell it works flawlessly (i need to
substitute some variables instead of the HTTP POST that it uses via a
browser, but it works none the less!). I'm starting to wonder weather
its my code or a unix permissions thing.

Basically, when its executed from a shell, it sends the message, the
subject and body are correct, but when i run it from a web browser it
results in a message, with no subject, and no body.

Here's the line which i'm using to try to execute the mail command:

system "/bin/echo $entry | /bin/mail -s \"Log entry added to TN:
$ticketnum\" $emaillist[0]";

I know it may not be the best way to do it, but like i said, it works if
i execute it from a shell. This is my first big perl project, so be
nice.

Thanks!
--
In a world with no fences, why do I need Gates?
 
Reply With Quote
 
 
 
 
Nathan
Guest
Posts: n/a
 
      04-04-2006
I've gotten this working using sendmail. My script writes the e-mail to
temporary file, and then pipes that file through sendmail.
But, it would still be great to be able to just use a one-liner to send
it through mail instead.

Any suggestions are still welcome.

Thanks!

Nathan wrote:
> This may be a basic task to some of you perl guru's, but I have a
> problem getting a perl script i've written, when executed by httpd, to
> send out an e-mail.
>
> Basically, i have a few variables passed into this script, it writes
> them to a a database, and then its supposed to read the "E-mail list"
> attached to that database entry and shoot an e-mail off to everyone in
> that list letting them know that there's been an update.
> I have what would seem like all of the difficult things done! It takes
> the variables, writes them to the database, reads the list (which is
> currently only my e-mail address" and then sends the message. The
> problem is that the message is empty!
> If i execute the script at a shell it works flawlessly (i need to
> substitute some variables instead of the HTTP POST that it uses via a
> browser, but it works none the less!). I'm starting to wonder weather
> its my code or a unix permissions thing.
>
> Basically, when its executed from a shell, it sends the message, the
> subject and body are correct, but when i run it from a web browser it
> results in a message, with no subject, and no body.
>
> Here's the line which i'm using to try to execute the mail command:
>
> system "/bin/echo $entry | /bin/mail -s \"Log entry added to TN:
> $ticketnum\" $emaillist[0]";
>
> I know it may not be the best way to do it, but like i said, it works if
> i execute it from a shell. This is my first big perl project, so be
> nice.
>
> Thanks!



--
In a world with no fences, why do I need Gates?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FAQ 2.13 What mailing lists are there for Perl? PerlFAQ Server Perl Misc 0 02-01-2011 05:00 AM
About the Perl Mailing List Database phantasia Perl Misc 0 12-11-2007 03:42 AM
Perl Mailing List script poopdeville@gmail.com Perl Misc 1 02-01-2006 09:53 PM
Searching perl cgi script that implements a Mailing-List Tom Parson Perl Misc 0 12-30-2003 06:25 PM
Perl Help - Windows Perl script accessing a Unix perl Script dpackwood Perl 3 09-30-2003 02:56 AM



Advertisments