Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sendmail & perl

Status
Not open for further replies.

clarissa1996

Technical User
Jan 31, 2002
78
CH
To send a message with perl I use the following program:

$mailprog = "/usr/lib/sendmail -t";
open (MAIL, "|$mailprog");
print MAIL "To: $to\n";
print MAIL "From: $from\n";
printf MAIL ("Subject: $subject\n\n");
print MAIL "$message\n";
close MAIL;

The problem is that if the recipient ($to) do not exist, the error is sent to the user that starts the program and not to the sender ($from).

Is there a solution ?

Thanks for any help. M. Rezzonico

 
try to use Reply-To field

don't remember the exact syntax, just remember that there is such a field..

Victor
 
Code:
print MAIL "From: someone\@somewhere.com\n";
print MAIL "Reply-To: some_other\@somewhereelse.com\n";
print MAIL "Errors-to: you\@there.com\n";
print MAIL "Subject: of a verb\n";
print MAIL "Precedence: bulk\n\n";
print MAIL "-------------------------------------------\n";
print MAIL "Message Content\n";
close MAIL;
'hope this helps

If you are new to Tek-Tips, please use descriptive titles, check the FAQs, and beware the evil typo.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top