Sponsored Content
Operating Systems Linux Replace A File From Email Attachment Post 302778663 by Corona688 on Monday 11th of March 2013 11:14:13 AM
Old 03-11-2013
Bumping up posts or double posting is not permitted in these forums.

Please read the rules, which you agreed to when you registered, if you have not already done so.

You may receive an infraction for this. If so, don't worry, just try to follow the rules more carefully. The infraction will expire in the near future

Thank You.

The UNIX and Linux Forums.
 

10 More Discussions You Might Find Interesting

1. How do I send email?

Transfering unix file as an email attachment

I've written a a script which generates a report file, saved to a unix directory. I need to transfer it, via email, to some users. The command I'm using in my script is: (note that subject & cur_address are set in the script prior to this line) cat /u/sandyl/sm_o_commdt_archive/c | uuencode... (3 Replies)
Discussion started by: slivi
3 Replies

2. UNIX for Dummies Questions & Answers

Transfering unix file as an email attachment

I've written a a script which generates a report file, saved to a unix directory. I need to transfer it, via email, to some users. The command I'm using in my script is: (note that subject & cur_address are set in the script prior to this line) cat /u/sandyl/sm_o_commdt_archive/c | uuencode... (3 Replies)
Discussion started by: slivi
3 Replies

3. Shell Programming and Scripting

UNIX file attachment in email

Hi, I have a syntax for mail attachment as $EMAIL "Wrapper $wrapper_script_name has failed" " $wrapper_script_name has Failed " $failed_email_address and $EMAIL is as below MSGSub=${1} MSGText=${2} RMAIL=${3} #set LANG='' export LANG='' echo "${MSGSub}" | mailx -s "${MSGText}" ... (1 Reply)
Discussion started by: satgur
1 Replies

4. Shell Programming and Scripting

Sending email and attachment file using Perl

I am trying to send an email body of information and also attachment using perl script, but I am only able to send the body but not an attachment. is there around it without using "use MIME::Lite;" module. $user = "bataf\@xyz.com"; $subjectt = "mail from perl"; open(MAIL, "| mailx -s... (1 Reply)
Discussion started by: bataf
1 Replies

5. Shell Programming and Scripting

Send a file through email using cron as an attachment

Hi All, I want to send a file as an attachment through cron job.Is this possible using cronjob nd if it i, can you please let me know how to do this? Thanks (2 Replies)
Discussion started by: NARESH1302
2 Replies

6. UNIX for Advanced & Expert Users

email file as attachment...

Hello all, i am on hp-ux 11.23...i am trying to send an email as an attachement but it dose not seem to work...after reading on google i found that we can use uuencode to send file at attachement...here is my file and the syntax $ cat test.txt NAME --------- TEST $ uuencode... (7 Replies)
Discussion started by: abdul.irfan2
7 Replies

7. Shell Programming and Scripting

Sending a file as an attachment to email

The file is located under appl/batchdata/ file name: storesales.txt I am using following code because uuencode is not present. I am not getting the data in file but i am getting the blank file with same name as an email attachment. ( echo "from: sch@xxxx.com" echo "to:sch@xxxx.com" echo... (2 Replies)
Discussion started by: skatpally
2 Replies

8. Shell Programming and Scripting

Replace A File From Email Attachment

I am looking for a method that would allow me to replace an existing file with one from an email attachment. Any way of scripting this, so when an email comes in from a particular email id, it takes the attached file, and replaces an existing file. (6 Replies)
Discussion started by: evencustard
6 Replies

9. Shell Programming and Scripting

Email with .dat file as attachment

Hi, I am trying to email a .dat file as an attachment from unix MS-outlook. I tried uuencode but it is not attaching the file, rather it is placing some junk data in the body of mail. Below is my code (cat Message.txt; uuencode Attach_File.DAT Attch_File.DAT) | mailx -s "SUBJECT"... (12 Replies)
Discussion started by: sampoorna
12 Replies

10. UNIX for Dummies Questions & Answers

Cronjob output to file AND to email (as attachment)

I have a shell script that runs on our webserver logs, and grabs various useful data and then outputs this data to a .csv file. What I want to do now is schedule a cronjob to run this script for me each week at a designated time, AND email the .csv file that is created as an attachment to... (1 Reply)
Discussion started by: xdawg
1 Replies
Email::Simple(3pm)					User Contributed Perl Documentation					Email::Simple(3pm)

NAME
Email::Simple - simple parsing of RFC2822 message format and headers SYNOPSIS
use Email::Simple; my $email = Email::Simple->new($text); my $from_header = $email->header("From"); my @received = $email->header("Received"); $email->header_set("From", 'Simon Cozens <simon@cpan.org>'); my $old_body = $email->body; $email->body_set("Hello world Simon"); print $email->as_string; ...or, to create a message from scratch... my $email = Email::Simple->create( header => [ From => 'casey@geeknest.com', To => 'drain@example.com', Subject => 'Message in a bottle', ], body => '...', ); $email->header_set( 'X-Content-Container' => 'bottle/glass' ); print $email->as_string; DESCRIPTION
"Email::Simple" is the first deliverable of the "Perl Email Project." The Email:: namespace was begun as a reaction against the increasing complexity and bugginess of Perl's existing email modules. "Email::*" modules are meant to be simple to use and to maintain, pared to the bone, fast, minimal in their external dependencies, and correct. METHODS
new my $email = Email::Simple->new($message, \%arg); This method parses an email from a scalar containing an RFC2822 formatted message and returns an object. $message may be a reference to a message string, in which case the string will be altered in place. This can result in significant memory savings. If you want to create a message from scratch, you should use the "create" method. Valid arguments are: header_class - the class used to create new header objects The named module is not 'require'-ed by Email::Simple! create my $email = Email::Simple->create(header => [ @headers ], body => '...'); This method is a constructor that creates an Email::Simple object from a set of named parameters. The "header" parameter's value is a list reference containing a set of headers to be created. The "body" parameter's value is a scalar value holding the contents of the message body. Line endings in the body will normalized to CRLF. If no "Date" header is specified, one will be provided for you based on the "gmtime" of the local machine. This is because the "Date" field is a required header and is a pain in the neck to create manually for every message. The "From" field is also a required header, but it is not provided for you. header_obj my $header = $email->header_obj; This method returns the object representing the email's header. For the interface for this object, see Email::Simple::Header. header_obj_set $email->header_obj_set($new_header_obj); This method substitutes the given new header object for the email's existing header object. header my @values = $email->header($header_name); my $first = $email->header($header_name); In list context, this returns every value for the named header. In scalar context, it returns the first value for the named header. header_set $email->header_set($field, $line1, $line2, ...); Sets the header to contain the given data. If you pass multiple lines in, you get multiple headers, and order is retained. If no values are given to set, the header will be removed from to the message entirely. header_names my @header_names = $email->header_names; This method returns the list of header names currently in the email object. These names can be passed to the "header" method one-at-a-time to get header values. You are guaranteed to get a set of headers that are unique. You are not guaranteed to get the headers in any order at all. For backwards compatibility, this method can also be called as headers. header_pairs my @headers = $email->header_pairs; This method returns a list of pairs describing the contents of the header. Every other value, starting with and including zeroth, is a header name and the value following it is the header value. body Returns the body text of the mail. body_set Sets the body text of the mail. as_string Returns the mail as a string, reconstructing the headers. crlf This method returns the type of newline used in the email. It is an accessor only. default_header_class This returns the class used, by default, for header objects, and is provided for subclassing. The default default is Email::Simple::Header. CAVEATS
Email::Simple handles only RFC2822 formatted messages. This means you cannot expect it to cope well as the only parser between you and the outside world, say for example when writing a mail filter for invocation from a .forward file (for this we recommend you use Email::Filter anyway). For more information on this issue please consult RT issue 2478, <http://rt.cpan.org/NoAuth/Bug.html?id=2478>. PERL EMAIL PROJECT
This module is maintained by the Perl Email Project <http://emailproject.perl.org/> AUTHORS
Simon Cozens originally wrote Email::Simple in 2003. Casey West took over maintenance in 2004, and Ricardo SIGNES took over maintenance in 2006. COPYRIGHT AND LICENSE
Copyright 2004 by Casey West Copyright 2003 by Simon Cozens This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2011-12-23 Email::Simple(3pm)
All times are GMT -4. The time now is 11:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy