Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 11-28-2008, 07:56 AM   #1
Registered: May 2004
Location: bangalore
Distribution: Cent OS, Ubuntu
Posts: 109

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.

Please see the Script below,

open (INFO, "/athreya/Qtrees");
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";


Can in any way we change the From header?

Thanks and Regards,

Athreya VC
Old 11-28-2008, 08: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;'.


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 06:43 PM
Cron Email Notification - Perl Script jamesyreid Programming 3 07-21-2009 08:56 AM
perl script to report new mail nibbler Programming 1 07-02-2005 10:13 AM
Linux Mail Header script/system luckyduckydave Linux - General 0 05-20-2004 09:41 PM
changing mail header Van jan Linux - Security 1 03-30-2004 12:03 PM

All times are GMT -5. The time now is 12:07 PM.

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