Quote:
Originally Posted by pbxuser911
how can i add which email address it will display its coming from?
|
Code:
/usr/sbin/sendmail -f from@test.com to@test.com < file
OR
simple perl will do it..
Code:
#!/usr/bin/perl
use strict;
use warnings;
my @body = `cat file.txt`;
open MAIL, "|/usr/sbin/sendmail -t user\@host.net\n" or die "cannot open sendmail program: $!\n";
print MAIL "From: user\@host.net\n";
print MAIL "Cc: user\@host.net\n";
print MAIL "Subject: subject\n";
print MAIL "\n";
print MAIL "@body\n";
close MAIL;
file.txt can hold the contents of the email and be in the same directory as the script itself.