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: Beginner:
Question about sendmail CGI script

 



timaratz
Deleted

Jun 21, 2000, 5:18 PM

Post #1 of 3 (452 views)
Question about sendmail CGI script Can't Post

When I run the CGI script below I get this error message: 'Recipient names must be specified'.

------
#!/usr/bin/perl -w

#### Send an e-mail
$MailProgram = '/usr/sbin/sendmail';
$From = 'xxx@abc.com';
$To = 'xxx@test.com';
$Subject = "CGI e-mail test";

open (MAIL,"|$MailProgram") or die;
print MAIL "From: $From\n";
print MAIL "To: $To\n";
print MAIL "Subject: $Subject\n";
print MAIL "-------------------\n\n";
print MAIL "this is the body\n\n";
print MAIL "-------------------\n\n";
close (MAIL);

print "Content-type: text/html\n\n";
print "E-mail sent 2";


Kanji
User / Moderator

Jun 21, 2000, 6:18 PM

Post #2 of 3 (452 views)
Re: Question about sendmail CGI script [In reply to] Can't Post

You need to tell sendmail to look in the contents of the message for the recipient details if you don't supply them as arguments.

Unless you have good reason not to, you should call sendmail with the -t (pull the recipient from the message) and -oi (don't assume a lone dot to be the end of message indicator) flags.


timaratz
Deleted

Jun 22, 2000, 4:40 AM

Post #3 of 3 (452 views)
Re: Question about sendmail CGI script [In reply to] Can't Post

Kanji, Thanks, that solved it.

 
 


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

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