Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Script for sending email with attachment using Linux console

Status
Not open for further replies.

rsrinivas

Advanced Member level 1
Joined
Oct 10, 2006
Messages
411
Helped
50
Reputation
100
Reaction score
11
Trophy points
1,298
Location
bengalooru
Activity points
3,689
Hi
can anyone give me a small script to send mail with an attachment using my linux console.
Regards
 

Re: mail using perl

I AM VERY MUCH EAGER TO KNOW HOW WE CAN DO THIS?
I HOPE WE SHOULD USE SOME FILE MANIPULATION
TECHNIQUES..
 

Re: mail using perl

did u you use mail -- the shell command...
or use Mail::Sendmail module in perl.....
 

mail using perl

this is definately off-topic here but check the mail or mailx command on your shell, it is quite simple to use and you can use it inside synthesis scripts to notify you when a task is finished
 

Re: mail using perl

I hope this script may help u.
Pl be sure to configure the sendmail to send mail to any mail ID.


#! /usr/bin/ksh
MTA=/usr/lib/sendmail
VERSION=1.0

{
echo "From: jdoe <John Doe>"
echo "To: tom.jones@whatever.com <tom jones>"
echo "Subject: test 2"
echo "X-Mailer: htmlmail" $VERSION
echo "Mime-Version: 1.0"
echo "Content-Type: text/html; charset=US-ASCII"
echo
echo "<center> <h1> Test Center Heading </h1> </center>"
echo "

This is some text. And so is this. </p>"

} | eval $MTA "tom.jones@whatever.com"

exit 0
 

Re: mail using perl

some example you can find in the bbs!
 

Re: mail using perl

Try the following section of code (perl script):

open (MAILFD, "| /usr/lib/sendmail -it") || die "Cannot run sendmail... $!";
print MAILFD "From: <your mail id>\n";
print MAILFD "To: <recipient id>\n";
print MAILFD "Subject: <subject>\n";
print MAILFD "<message body>";
close (MAILFD);

If this doesn't work check the path for sendmail by typing "which sendmail".
Also check whether your sendmail is configured properly.
There is a configuration file sendmail.cf in /etc/mail/
 

Re: mail using perl

Hi,

pls check this :
mail -v -s "Subject" <email-ID of recipient> < <Body of the message >

Thanks..

HAK..
 

mail using perl

I guess the point has not been addressed yet -
rsrinivas asked - how to on "attachment", in addition to rest.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top