Sponsored Content
Top Forums Shell Programming and Scripting MIME - HTML mail with Excel attachment - Please help! Post 302527164 by DGPickett on Thursday 2nd of June 2011 04:48:47 PM
Old 06-02-2011
openssl has a base64 encoder.

mutt would be simpler.

Last edited by DGPickett; 06-02-2011 at 06:01 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Send an attachment and html text both in the same mail

Hi all, I am working on UNIX (Solaris28). I would like to send an email in which the body will be in html format and, in the same mail, a xls file has to be attached. I have tried this: the file is correctly attached but the body comes as html source and not formatted. If I do not attach the... (4 Replies)
Discussion started by: stefan.yu
4 Replies

2. Shell Programming and Scripting

Sending HTML attachment through mail

Hi I am new to unix and scripting.I am trying to send a html file as an attachment. SUBJECT="Type of Exceptions in Application" TO=Sushovan.Samals@gmail.com SPOOLFILE=/data/reg/tlogs/Monitor.html #echo "Send the E-mail message..." uuencode $SPOOLFILE $SPOOLFILE | mailx -s "$SUBJECT" $TO... (2 Replies)
Discussion started by: sushovan
2 Replies

3. UNIX for Dummies Questions & Answers

Excel attachment in e-mail

Hi, I have to send the query output as an excel attachmet from UNIX Shell script, for this i have written following shell script and sql file this shell script has created the ho.xls file with correct query output but it doesn't generate the mail that shold contain query output as an excel... (5 Replies)
Discussion started by: karthikeyanjo
5 Replies

4. Shell Programming and Scripting

Script to Convert HTML to MIME mail -- HELP!

Hi: I have writed a script that read a HTML file and convert this in a multipart mime fail to send in a mail. But the result isn't interpreted lika a mime file!! Somebody can see the error??? --------------------------- #! /bin/bash SB=$1 IF=$2 OF=$3 rm -f $OF.b64 ... (7 Replies)
Discussion started by: sushisan
7 Replies

5. HP-UX

How to attach an excel file in a multipart (mime) mail

Hello. I need to send mails from hp-ux with 2 attachments: a text file and an excel file. So I'm composing a mime file which I will pipe to sendmail utility. This works fine if the only attachment is the text file (i use cat command to attach text content). But I have problems with the format... (3 Replies)
Discussion started by: elcampio
3 Replies

6. UNIX for Dummies Questions & Answers

How to send html file in a mail not as an attachment but it should display in the mail in table for

Hi The below script working when we are sending the html as attachment can u please guide how to send thesmae data in table form direct in the mail and not in mail attachment . cat Employee.sql SET VERIFY OFF SET PAGESIZE 200 SET MARKUP HTML ON SPOOL ON PREFORMAT OFF ENTMAP ON - HEAD... (0 Replies)
Discussion started by: mani_isha
0 Replies

7. Shell Programming and Scripting

Need help in sending html mail with attachment

Hi Everyone, I am facing problems in sending html mail with attachemnt. I will able to send mail with attachment (plain text ) using mailx -s and uuencode command and also html mail without attachment using sendmail option. However I am not able to send html mail along with attachment.Either... (2 Replies)
Discussion started by: karthik adiga
2 Replies

8. Shell Programming and Scripting

HTML mail with Attachment

Hi, I am using the below code: #!/bin/ksh SUBJ="Send mail from Unix with file attachments" TO=sudha.viswanathan@jpmorgan.com CC=sudha.viswanathan@jpmorgan.com ( cat << ! To : ${TO} Subject : ${SUBJ} Cc : ${CC} ! cat << ! MIME-Version: 1.0 Content-Type: text/html `cat... (1 Reply)
Discussion started by: sudvishw
1 Replies

9. UNIX for Beginners Questions & Answers

Excel attachment in e-mail

i am trying to get an SQL output into an excel attachment and the other output into mail body as excel format. i am getting the excel format in the mail body, but i am not getting the excel attachment. and the output is coming in one cell in the excel. is it possible to get the excel output with... (11 Replies)
Discussion started by: maddelav
11 Replies

10. UNIX for Beginners Questions & Answers

Sending Excel Files as attachment using Mail

Hie, I need to attach an .xlsx file as an attachment to a mail. I have used the mail option but i dont think there is anything for attachment. Can you show me how else can i do it? I am not allowed to install mutt since it is a workplace and they have their restrictions. And its a Bash Shell (2 Replies)
Discussion started by: barryallen
2 Replies
Encode::Encoder(3pm)					 Perl Programmers Reference Guide				      Encode::Encoder(3pm)

NAME
Encode::Encoder -- Object Oriented Encoder SYNOPSIS
use Encode::Encoder; # Encode::encode("ISO-8859-1", $data); Encode::Encoder->new($data)->iso_8859_1; # OOP way # shortcut use Encode::Encoder qw(encoder); encoder($data)->iso_8859_1; # you can stack them! encoder($data)->iso_8859_1->base64; # provided base64() is defined # you can use it as a decoder as well encoder($base64)->bytes('base64')->latin1; # stringified print encoder($data)->utf8->latin1; # prints the string in latin1 # numified encoder("x{abcd}x{ef}g")->utf8 == 6; # true. bytes::length($data) ABSTRACT
Encode::Encoder allows you to use Encode in an object-oriented style. This is not only more intuitive than a functional approach, but also handier when you want to stack encodings. Suppose you want your UTF-8 string converted to Latin1 then Base64: you can simply say my $base64 = encoder($utf8)->latin1->base64; instead of my $latin1 = encode("latin1", $utf8); my $base64 = encode_base64($utf8); or the lazier and more convoluted my $base64 = encode_base64(encode("latin1", $utf8)); Description Here is how to use this module. o There are at least two instance variables stored in a hash reference, {data} and {encoding}. o When there is no method, it takes the method name as the name of the encoding and encodes the instance data with encoding. If successful, the instance encoding is set accordingly. o You can retrieve the result via ->data but usually you don't have to because the stringify operator ("") is overridden to do exactly that. Predefined Methods This module predefines the methods below: $e = Encode::Encoder->new([$data, $encoding]); returns an encoder object. Its data is initialized with $data if present, and its encoding is set to $encoding if present. When $encoding is omitted, it defaults to utf8 if $data is already in utf8 or "" (empty string) otherwise. encoder() is an alias of Encode::Encoder->new(). This one is exported on demand. $e->data([$data]) When $data is present, sets the instance data to $data and returns the object itself. Otherwise, the current instance data is returned. $e->encoding([$encoding]) When $encoding is present, sets the instance encoding to $encoding and returns the object itself. Otherwise, the current instance encoding is returned. $e->bytes([$encoding]) decodes instance data from $encoding, or the instance encoding if omitted. If the conversion is successful, the instance encoding will be set to "". The name bytes was deliberately picked to avoid namespace tainting -- this module may be used as a base class so method names that appear in Encode::Encoding are avoided. Example: base64 transcoder This module is designed to work with Encode::Encoding. To make the Base64 transcoder example above really work, you could write a module like this: package Encode::Base64; use base 'Encode::Encoding'; __PACKAGE__->Define('base64'); use MIME::Base64; sub encode{ my ($obj, $data) = @_; return encode_base64($data); } sub decode{ my ($obj, $data) = @_; return decode_base64($data); } 1; __END__ And your caller module would be something like this: use Encode::Encoder; use Encode::Base64; # now you can really do the following encoder($data)->iso_8859_1->base64; encoder($base64)->bytes('base64')->latin1; Operator Overloading This module overloads two operators, stringify ("") and numify (0+). Stringify dumps the data inside the object. Numify returns the number of bytes in the instance data. They come in handy when you want to print or find the size of data. SEE ALSO
Encode, Encode::Encoding perl v5.18.2 2014-01-06 Encode::Encoder(3pm)
All times are GMT -4. The time now is 10:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy