Seems Complicated but would b happy if its possible

Hey guys, I m here again with (may b) a silly query n sorry for that, I am new to UNIX n all so don't kno much @ it.
Thro' a script I am generating an output (It is a TXT file) After generating it, I get it to windows n mails it by dragging n dropping it in lotus mail new mail window.
Is there any way out by which I can automate this process?

Use the mailx command in unix to send the mails..

man mailx

If you are scripting in perl, this might help you..

sub _send_email($$$) {
	my $recipient = shift;
	my $full_name = shift;
	my $result_file = shift;
	my $res_file = basename($result_file);
	my $res_dir = dirname($result_file);
	chomp(my $hostname = qx/uname -n/);

	my $msg = MIME::Lite->new(
		From => '"Manager Issuance" <abc@@xyz.com>',
		To => "\"$full_name\" <$recipient>",
		Subject => "Results of deck_check.upl for $input_dir on $hostname",
		Type => 'multipart/mixed',
		Data => "The results of your deck_check.upl run are attached."
	);

	$msg->attach(
		Type => 'TEXT',
		Data => "Hello,\n$full_name\n\nPlease DO NOT reply to this email!\n\nIt was generated by a non-user account.  Attached is a file\ncontaining the results of your requested run.\n\nThank You,\n
	);

	$msg->attach(
		Type => 'TEXT',
		Path => "$result_file",
		Filename => "$res_file",
		Disposition => 'attachment'
	);

	$msg->send("sendmail");
}

Hey Thak you very much for the reply but can u explain it to me.. plz... take an example of my out put file.. suppose its name is "123456.txt" n o/p is going to get generated on path /temp/anushree/output/123456.txt n i want to send the email as it gets generated.
Plz help... Is it possible?

Through which script the file is being generated, you need to add following line to script.

mail -s "Log file attached" <email Id> < <Logfile name>

I think it will solve your problem.

Thanks & Regards,
Siba

Hey Siba, thanx for the reply
In <log file> should i type o/p file which is to be mailed?

No, not in Log file. How the log file is created? I think it is being created when one file is executed and in that file the it is also mentioned where where it will create the log file.

You need to add above things to the file which is responsible to create the log file.

Regards,
Siba

Siba, the "mail" tool doesn't accept attachment like this, at least not on Debain Linux nor on AIX (at least not that I know of).

Easiest is maybe:

(echo "some mail body text blablabla" | uuencode somefile.dat somefile.dat) | mail -s "some subject" jupp@juppes.org

For uuencode you can use the same infile's name for the one being encoded, up to you ^^