mail from unix

hi
i looked at different threads on how to send mail from unix. but i want to ask how can i send mail when my unix server is only connected to mail server this i know cause i can ping it to that server.
how can send mail with help of that mail server ? i do have mail id on that server.
i know perl & shell any ideas will be helpful.

The question is a bit under-specific. Does sending mail not work at the moment, or do you lack the software to send mail? Is installing a simple mail server out of the question? Sendmail, Postfix, Exim etc. are all possible to configure to simply relay to a "smarthost", in most cases with a minimal effort. Or with a simple Perl script you could talk SMTP directly to the mail server, is that what you want?

thanx for reply

sorry for not being specific ...

need some help for this

Hmm, you're still not very specific.

Net::SMTP - Simple Mail Transfer Protocol Client - search.cpan.org

The RFC is fairly technical but there's a metric gajillion tutorials in Google. For getting started you really only need to understand EHLO, MAIL FROM, RCPT TO, and DATA. Once you grok those the next step is probably actually to tackle RFC2822 and in particular to understand how MIME fits into the picture. (Go on, Google for those. And those others.)

thanx for the link i will read it and in case of any doubts i will get back

to be specific here is what i want to do :

i have written a scripts which compiles newly created programs after every 2 hr ( cron job ) which generates 2-3 log files. every time someone has to goto actual log file to see if everything went well. instead of this i want same program to generate mail and send it to specific mail id ( generating mail is not a problem ) on desktop i can do this with mailx command and it works perfectly but in my office as unix servers are not connected to network i can not use "mailx" but its connected to mail server.

so i want to write a script which will talk to mail server, which will send mail to specific person.

Still sounds like you should simply install mailx and Postfix and configure it to only talk to your mail server. It can work in an intranet just fine (and indeed, must).

hey era i used EasyMail to send mail ...which works @ my workplace

but problem is that that script hangs when i try to send mails using my gmail account. i am using smtp server address [ which i get after pinging smtp.gmail.com ] and port is 465. but nothing happen.. script just hangs

here is the link for EasyMail EasyMail - Perl Send Mail Interface - search.cpan.org

here is my code ...

C:\Documents and Settings\Zedex>ping smtp.gmail.com

Pinging gmail-smtp.l.google.com [209.85.147.111] with 32 bytes of data:

Reply from 209.85.147.111: bytes=32 time=261ms TTL=236
Reply from 209.85.147.111: bytes=32 time=261ms TTL=236

#! /usr/bin/perl -w
use EasyMail ;
use strict ; 

my $mail = {
             'sender_type'  => "SMTPAUTHLOGIN" ,
	     'smtp_host'    => "209.85.147.111" ,
	     'smtp_port'    => "465",
	     'smtp_usr'     => "myid\@gmail.com",
	     'smtp_pass'    => "pass",
	     'type'         => "plain",
	     'subject'      => "Test Mail",
	     'body'         => "This is a test message from unix sent with EasyMail",
	     'from'         => "myid\@gmail.com",
	     'to'           => "testid\@abc.com",
	     'cc'           => "test1\@abc.com",
	     'src_encoding' => "NONE",
	     'dst'          => "un"
	  };
print "Message formed now sending ...\n" ;
EasyMail::sendmail($mail) ;
print "Mail sent ...\n" ;
if ( defined($mail->{'error'})){
    print "Mail sending failed....\n" ;
}