Sponsored Content
Top Forums Shell Programming and Scripting Sending Multiple Files through email Post 67896 by RTM on Tuesday 29th of March 2005 08:49:41 AM
Old 03-29-2005
Merged multiple threads - please read the rules - especially about double posting.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sending mutiple files thru email to lotus notes

Hi All, I am currently using the following script to send the single file to one/more email addresses. I need to send mutilple files at same time, are there anyway I could modify the script or write new one to accomplish the same. Script *************** #!/bin/ksh # Author: Manish... (4 Replies)
Discussion started by: lapisguy
4 Replies

2. Shell Programming and Scripting

Sending an email with more than one files

Hi, I would like to send an email with more than one attachement. I am using uuencode. I want to achive by suing uuencode. Also please let me know other ways. -Thambi (7 Replies)
Discussion started by: thambi
7 Replies

3. HP-UX

Sending Unix files as attachments in an email

Hi, I am executing the following command in order to send a file as an attachment: mailx -s "Subject" emailID@xyz.com < Testfile.txt Instead of attaching the file Testfile.txt, it is writing the contents of the file in the email message body. Please advise on how I can send the file as an... (7 Replies)
Discussion started by: sangharsh
7 Replies

4. HP-UX

Sending email to multiple IDs

Hi, I am trying to send an email to multiple IDs from Unix script. I have given the EmailIds in a file and trying to use the file as input in the script. > cat Email EmailID = "abc@xyz.com cbz@xyz.com" In my script I have . /Email mailx -s "subj" $EmailID This fails with the... (3 Replies)
Discussion started by: sangharsh
3 Replies

5. Shell Programming and Scripting

Sending email with multiple files..

Hello,, I am loading data into the 4 tables from 4 different input files. The data gets loaded, and the e-mail is also sent to the user, but the log files for all the 4 files is not been sent.. I am trying to send e-mail to users with the log file as attachment. The script is as follows:... (30 Replies)
Discussion started by: msrahman
30 Replies

6. UNIX for Dummies Questions & Answers

Zipping files and sending email

Hi, I need to zip 4 files and send an email attaching the zipped files... Pls help.. Win ---------- Post updated at 10:49 AM ---------- Previous update was at 10:36 AM ---------- Hi, I need to convert 4 text files into xls,zip these 4 files and send an email attaching the... (2 Replies)
Discussion started by: win4luv
2 Replies

7. Shell Programming and Scripting

sending multiple files along with mail message using uuencode

Hi, I have a requirement to send a mail with multiple files attached to it and along with the text message in the mail. I am trying sumthing like below but it only sends me the text message and no files attached to the mail. ---------------------------------------- ( uuencode file1... (1 Reply)
Discussion started by: sachinkl
1 Replies

8. Solaris

Sending Mails to the Multiple Email Address

Hi All, I am pretty new to the mail service in Sun Solaris 5.10. If anybody help me in writing a script for the multiple recipient with subject and the body would be a helpful. Kindly help... Thanks in advance. :) Warm Regards, Pramod (5 Replies)
Discussion started by: Pramod_009
5 Replies

9. Shell Programming and Scripting

Sending files to multiple emails

Hi All, I want to send each file to each email id as below. Instead of writing saparate 10 mail commands can we do it in a simple step. file1.csv to raghu.s@hps.com file2.csv to kiran.m@hps.com file3.csv to kenni.d@hps.com file4.csv to rani.d@hps.com file5.csv to sandya.s@hps.com... (2 Replies)
Discussion started by: ROCK_PLSQL
2 Replies

10. Shell Programming and Scripting

Sending multiple files using uuencode command

Hi All, I want to send multiple CSV file using below code. In Result folder, we have multiple CSV files. However, I want to catch only Summary CSV files. I was trying using *, % with different combination. However, not able to do so. From below code, I could send only one file... (1 Reply)
Discussion started by: Swapnil Mawle
1 Replies
Courriel::Builder(3pm)					User Contributed Perl Documentation				    Courriel::Builder(3pm)

NAME
Courriel::Builder - Build emails with sugar VERSION
version 0.29 SYNOPSIS
use Courriel::Builder; my $email = build_email( subject('An email for you'), from('joe@example.com'), to( 'jane@example.com', 'alice@example.com' ), header( 'X-Generator' => 'MyApp' ), plain_body($plain_text), html_body( $html, attach('path/to/image.jpg'), attach('path/to/other-image.jpg'), ), attach('path/to/spreadsheet.xls'), attach($file_content), ); DESCRIPTION
This module provides some sugar syntax for emails of all shapes sizes, from simple emails with a plain text body to emails with both plain and html bodies, html with attached images, etc. API
This module exports all of the following functions by default. It uses Sub::Exporter under the hood, which means you can easily import the functions with different names. See Sub::Exporter for details. build_email( ... ) This function returns a new Courriel object. It takes the results of all the other functions you call as input. It expects you to pass in a body of some sort, whether text, html, or both, and will throw an error if you don't. It will add Date and Message-ID headers to your email if you don't provide them, ensuring that the email is RFC-compliant. subject($subject) This sets the subject of the email. It expects a single string. You can pass an empty string, but not "undef". from($from) This sets the From header of the email. It expects a single string or Email::Address object. to($from) This sets the To header of the email. It expects a list of string and/or Email::Address objects. cc($from) This sets the Cc header of the email. It expects a list of string and/or Email::Address objects. bcc($from) This sets the Bcc header of the email. It expects a list of string and/or Email::Address objects. header( $name => $value ) This sets a header's value. You can call it as many times as you want, and you can call it more than once with the same header name to set multiple values for that header. plain_body( ... ) This defines a plain text body for the email. You can call it with a single argument, a scalar or reference to a scalar. This creates a text/plain part based on the content you provide in that argument. By default, the charset for the body is UTF-8 and the encoding is base64. You can also call this function with a hash of options. It accepts the following options: o content The content of the body. This can be a string or scalar reference. o charset The charset for the body. This defaults to UTF-8. o encoding The encoding for the body. This defaults to base64. Other valid values are quoted-printable, 7bit, and 8bit. It is strongly recommended that you let Courriel handle the transfer encoding for you. html_body( ... ) This accepts the same arguments as the "plain_body()" function. You can also pass in the results of one or more calls to the "attach()" function. If you pass in attachments, it creates a multipart/related email part, which lets you refer to images by the Content-ID using the "cid:" URL scheme. attach( ... ) This function creates an attachment for the email. In the simplest form, you can pass it a single argument, which should be a path to a file on disk. This file will be attached to the email. You can also pass a hash of options. The valid keys are: o file The file to attach to the email. You can also pass the content explicitly. o content The content of the attachment. This can be a string or scalar reference. o filename You can set the filename that will be used in the attachment's Content-Disposition header. If you pass a "file" parameter, that will be used when this isn't provided. If you pass as "content" parameter, then there will be no filename set for the attachment unless you pass a "filename" parameter as well. o mime_type You can explicitly set the mime type for the attachment. If you don't, this function will use File::LibMagic to try to figure out the mime type for the attachment. o content_id This will set the Content-ID header for the attachment. If you're creating a HTML body with "cid:" scheme URLs, you'll need to set this for each attachment that the HTML body refers to. The id will be wrapped in angle brackets ("<id-goes-here>") when set as a header. COOKBOOK
Some examples of how to build different types of emails. Simple Email With Plain Text Body my $email = build_email( subject('An email for you'), from('joe@example.com'), to( 'jane@example.com', 'alice@example.com' ), plain_body($plain_text), ); This creates an email with a single text/plain part. Simple Email With HTML Body my $email = build_email( subject('An email for you'), from('joe@example.com'), to( 'jane@example.com', 'alice@example.com' ), html_body($html_text), ); This creates an email with a single text/html part. Email With Both Plain and HTML Bodies my $email = build_email( subject('An email for you'), from('joe@example.com'), to( 'jane@example.com', 'alice@example.com' ), plain_body($plain_text), html_body($html_text), ); This creates an email with this structure: multipart/alternative | |-- text/plain (disposition = inline) |-- text/html (disposition = inline) Email With Both Plain and HTML Bodies and Inline Images my $email = build_email( subject('An email for you'), from('joe@example.com'), to( 'jane@example.com', 'alice@example.com' ), plain_body($plain_text), html_body( $html_text, attach( file => 'path/to/image1.jpg', cid => 'image1', ), attach( file => 'path/to/image2.jpg', cid => 'image2', ), ), ); This creates an email with this structure: multipart/alternative | |-- text/plain (disposition = inline) |-- multipart/related | |-- text/html (disposition = inline) |-- image/jpeg (disposition = attachment, Content-ID = image1) |-- image/jpeg (disposition = attachment, Content-ID = image2) Email With Both Plain and HTML Bodies and Attachments my $email = build_email( subject('An email for you'), from('joe@example.com'), to( 'jane@example.com', 'alice@example.com' ), plain_body($plain_text), html_body( $html_text, ), attach('path/to/spreadsheet.xls'), attach( content => $png_image_content ), ); multipart/mixed | |-- multipart/alternative | | | |-- text/plain (disposition = inline) | |-- text/html (disposition = inline) | |-- application/vnd.ms-excel (disposition = attachment) |-- image/png (disposition = attachment) AUTHOR
Dave Rolsky <autarch@urth.org> COPYRIGHT AND LICENSE
This software is Copyright (c) 2012 by Dave Rolsky. This is free software, licensed under: The Artistic License 2.0 (GPL Compatible) perl v5.14.2 2012-03-07 Courriel::Builder(3pm)
All times are GMT -4. The time now is 05:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy