LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 11-28-2008, 06:56 AM   #1
athreyavc
Member
 
Registered: May 2004
Location: bangalore
Distribution: Cent OS, Ubuntu
Posts: 105

Rep: Reputation: 15
Changing the mail Header using Perl Email Script


Hi All,

I am a newbie to Perl Programming.

I want to send an email using perl Script. I am able to do that. Perl Script is running on a Solaris machine

But the From ID conatins the system name in the ID.

storage_admin.alt.ka@sm-ccstorage-1.alt.na.ka


Please see the Script below,

open (INFO, "/athreya/Qtrees");
@result=<INFO>;
close(INFO);
print @result;

$mailprog = '/usr/lib/sendmail';

open(MAIL,"|$mailprog -t");

print MAIL "To: athreya\@alt.ka\n";
print MAIL "From: storage@alt.ka\n";
print MAIL "Subject: $subject\n\n";


## Mail Body
print MAIL "Below Qtrees are nearing Full. Please do the Needful\n";
print MAIL @result;
print MAIL "\n";
print MAIL "Best Regards\n";
print MAIL "IT Admin";

close(MAIL);


Can in any way we change the From header?

Thanks and Regards,

Athreya VC
 
Old 11-28-2008, 07:07 AM   #2
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 453Reputation: 453Reputation: 453Reputation: 453Reputation: 453
perldoc perle
.

And _always_ use 'use strict;', 'use warnings;'.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
mail command + changing senders email address aeby Linux - Server 5 04-18-2010 05:43 PM
Cron Email Notification - Perl Script jamesyreid Programming 3 07-21-2009 07:56 AM
perl script to report new mail nibbler Programming 1 07-02-2005 09:13 AM
Linux Mail Header script/system luckyduckydave Linux - General 0 05-20-2004 08:41 PM
changing mail header Van jan Linux - Security 1 03-30-2004 11:03 AM


All times are GMT -5. The time now is 04:38 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration