1851702 Members
4667 Online
104062 Solutions
New Discussion

mail

 
SOLVED
Go to solution
maria fernanda
New Member

mail

hello as I can send an email with sendmail and attach a file with subject and copies to usuary others
or exite another option that is not sendmail
6 REPLIES 6
Sanjay_6
Honored Contributor

Re: mail

Hi Maria,

Look at the bottom of the page for IT resource center forums > hp-ux

Look at the "top read solutions"

Look for "Sending attachments via elm from command line"

Here is the link to that,

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x41950559ff7cd4118fef0090279cd0f9,00.html

Hope this helps.

Regds
Jairo Campana
Trusted Contributor
Solution

Re: mail

#!/usr/bin/perl
use CGI;

my $query = new CGI;
my $sendmail = "/usr/sbin/sendmail -t";
my $reply_to = "Reply-to: foo@bar.org";
my $subject = "Subject: Confirmaci??n de su solicitud";
my $content = "Gracias por su solicitud.";
my $to = $query->param('send_to');
my $file = "subscribers.txt";

unless ($to) {
print $query->header;
print "Por favor, escriba su email y vu??lvalo a intentar";
}

open (FILE, ">>$file") or die "Cannot open $file: $!";
print $to,"\n";
close(FILE);

my $send_to = "To: ".$query->param('send_to');

open(SENDMAIL, "|$sendmail") or die "Cannot open $sendmail: $!";
print SENDMAIL $reply_to;
print SENDMAIL $subject;
print SENDMAIL $to;
print SENDMAIL "Content-type: text/plain\n\n";
print SENDMAIL $content;
close(SENDMAIL);

print $query->header;
print "La confirmaci??n de su solicitud se le enviar?? ahora
legionx
Uday_S_Ankolekar
Honored Contributor

Re: mail

Hi,

You can use mailx or elm (Menu driven) to send an e-mail without useng "sendmail" option

Goodluck,
-USA..
Good Luck..
maria fernanda
New Member

Re: mail

I do not need elm so that it has to be automatic and mailx when attach shows the content
maria fernanda
New Member

Re: mail

uuencode file namefile | /usr/sbin/sendmail address email
where I write the subject?
Roger Baptiste
Honored Contributor

Re: mail

Maria,

To get what you want do this:

1) Create a mail_header file
with the following lines
****
To:xyz@aaa.com
Cc:cc@xyz.com,123@xxx.com
Subject:Your Subject

*****
2) Next create a script
"sendme.sh" with the lines
****
cat mail_header
uuencode
***
chmod 750 sendme.sh
3) then, send it!
./sendme.sh | sendmail -t

****

Works fine for me.

-raj
Take it easy.