Mutt for html body and multiple html & pdf attachments
Hi all:
Been racking my brain on this for the last couple of days and what has been most frustrating is that this is the last piece I need to complete a project.
There are numerous posts discussing mutt in this forum and others but I have been unable to find similar issues.
Running with RHEL 5.5, mutt 1.4.2.2i, perl 5.8.8
The issue is sending emails from command line using mutt. These emails can have 0 attachments to 5 attachments that can be a mix of html and/or pdf. Sending an email with html body/no attachments was simple;
Works, no problems.
When the -a options are included for the attachments I am still able to have the mail sent and it is received with an html body but the attachments become in line with the body making them unusable. If I add the
Quote:
-e my_hdr Content-Type:text/html
then the attachments are received fine but the body is plain text with all of the html markups in view.
I can add the
Quote:
-e my_hdr Content-Type:text/html
on the command line or in .muttrc, same effect. An example of the CLI;
.
How can I do this? It seems like I need the
Quote:
my_hdr Content-Type:text/html
off for the body of the email and then to turn it on for the attachments.
I was using MIME::Lite in a perl-cgi script but when the pdf attachments wouldn't work I was able to track it down to the
Quote:
POST vs GET
. There are numerous problems with pdf attachments originating from perl-cgi using the MIME::Lite module, mainly they would arrive in a corrupted state and not properly decoded making them unusable. The html attachments were fine.
If at all possible I want to avoid having to install another package. My feeling is that I will encounter similar issues other clients like mpack. Plus they are not installed and there are many hoops to jump through to get them installed.
Hi,
I am trying to convert html to pdf using perl module PDF::FromHTML, am getting the error as given below.
not well-formed (invalid token) at line 2, column 17, byte 56 at C:/Perl/lib/XML/Parser.pm line 187 at C:/Perl/site/lib/PDF/FromHTML.pm line 140
The perl code is as given... (2 Replies)
Hi folks,
I have a perl script which sends out email after successful completion of job as inline html, I want to send it out as two parts now as html inline and html attachment. see the attached script.
Thanks in advance (1 Reply)
Hi there..
I need a proper "mutt" command to send a mail with html body and html attachment at a time.
Also if possible let me know the other commands to do this task.
Please help me.. (2 Replies)
I have a html file:
# cat sample.html
<html>
<body>
Sample HTML file</p>
</body>
</html>
And I have two excel sheets (sheet1.xls & sheet2.xls)
I want to send an email by having the sample.html as the message body and two spreadsheets as the attachments.
I tried using the below command:... (12 Replies)
Hi All,
I want to attach the file as well send html content in the mail body using mutt command or any other command.(uuencode is not present). Please help me. Thanks in advance (1 Reply)
I am trying to attach multiple files using mutt command, and all file names to be attached are taken from a flat file. and mutt command is called from a bash script when :
1. Script execution is completed.
2. Script execution is interrupted for some reason.
... (8 Replies)
HI Team,
I used below code to get attachment with HTML body. i having21062013.csv file . but i am getting junk .csv file. Can you please help me out.
export MAILTO=rp908@gmail.com.com
export SUBJECT="Test Waiver Code email"
export BODY=test.html
export ATTACH=21062013.csv... (4 Replies)
Hi,
We have a requirement to send multiple attachment(pdf and csv) along with html content in a single mail. For that we are using uuencode. It is working for single pdf attachment and html content. But we are unable to send both pdf and csv attachment with html content. Below is the script.... (5 Replies)
Hi ,
I have a sql query in the unix script ,whose output is shown below.I want to convert this output to HTML table format & send email from unix with this table as email body.
p_id src_system amount
1 A 100
2 B 200
3 C ... (3 Replies)
Hi
I want to attach multiple index.html, index_v2 file using mutt command
basically i want first index.html and then index_v2.html file as a body in email , these html files are test reports
I am using following command , but it is over writing , any help appreceated ;)
mutt -e... (2 Replies)
Discussion started by: madankumar.t@hp
2 Replies
LEARN ABOUT SUSE
tnef
TNEF(1) General Commands Manual TNEF(1)NAME
tnef - decode Microsoft's Transport Neutral Encapsulation Format
SYNOPSIS
tnef [options] [FILE]
tnef {--help | --version}
DESCRIPTION
This manual page documents the tnef filter. tnef decodes e-mail attachments encoded in Microsoft's Transport Neutral Encapsulation Format
(hereafter, TNEF), which "wraps" Microsoft e-mail attachments.
Unfortunately, these "wrapped" attachments are inaccessible to any e-mail client that does not understand TNEF. Fortunately, the tnef fil-
ter can be used by any MIME-aware client to unpack these attachments.
OPTIONS -f FILE, --file=FILE
use FILE as input ('-' denotes stdin). When this option is omitted, tnef reads data from stdin.
-C DIR, --directory=DIR
unpack file attachments into DIR.
-x SIZE, --maxsize=SIZE
limit maximum size of extracted archive (bytes)
-t, --list
list attached files, do not extract.
-w, --interactive, --confirmation
ask for confirmation for every action.
--overwrite
when extracting attachments, overwrite existing files.
--number-backups
when extracting attachments, if file FOO will be overwritten, create FOO.n instead.
--use-paths
honor file pathnames specified in the TNEF attachment. For security reasons, paths to attached files are ignored by default.
--save-body FILE
Save message body data found in the TNEF data. There can be up to three message bodies in the file, plain text, HTML encoded, and
RTF encoded. Which are saved is specified by the --body-pref option. By default the message bodies are written to a file named
message with an extension based upon the type (txt, html, rtf).
--body-pref PREF
Specifies which of the possibly three message body formats will be saved. PREF can be up to three characters long and each charac-
ter must be one of 'r', 'h', or 't' specifying RTF, HTML or text. The order is the order that the data will be checked, the first
type found will be saved. If PREF is the special value of 'all' then any and all message body data found will be saved. The
default is 'rht'.
--save-rtf FILE
DEPRECATED. Equivalent to --save-body=FILE --body-pref=r
-h, --help
show usage message.
-V, --version
display version and copyright.
-v, --verbose
produce verbose output.
--debug
enable debug output.
EXAMPLE
The following example demonstrates typical tnef usage with a popular Unix mail client called "mutt".
Step 1 -- Configure ~/.mailcap
Mutt can't use tnef for its intended purpose until an appropriate content type definition exists in ~/.mailcap . Here's a sample defini-
tion:
application/ms-tnef; tnef -w %s
This mailcap entry says that whenever the MIME content type:
application/ms-tnef
is encountered, use this command to decode it:
tnef -w %s
The latter command string invokes tnef, specifying both the -w option and the attachment (created as a temporary file) as command line
arguments.
Step 2 -- Add The Filter To $PATH
Mutt can't invoke tnef if the filter isn't accessible via $PATH.
Step 3 -- Test Mutt
Use mutt to read a message that includes a TNEF attachment. Mutt will note that an attachment of type "application/ms-tnef is unsup-
ported".
Press the "v" key to open mutt's "view attachment" menu.
Move the cursor over the TNEF attachment and press the enter key to "view" the attachment. Mutt will launch tnef and invoke it using the
command line syntax specified in ~/.mailcap (step 1). tnef then decodes all file(s) included in the TNEF attachment, prompting for confir-
mation prior to creating an individual file (refer to -w option above). -w is useful here because it gives the end user a chance to view
the filename(s) included in the mail message.
Note that Mutt's attachment menu also supports a pipe option, which permits the user to pipe attachments to an external filter (how conve-
nient). So, to list the contents of a TNEF attachment prior to decoding it, press the "|" key and enter this command:
tnef -t
SEE ALSO metamail(1), mailcap(4), mutt(1), other email clients.
AUTHOR
Mark Simpson.
REPORTING BUGS
Report bugs to Mark Simpson <verdammelt@users.sourceforge.net>
OTHER REFERENCES
This web page:
http://support.microsoft.com/support/kb/articles/Q136/2/04.asp
describes how to configure Microsoft email clients so that the TNEF format is disabled when sending messages to non-TNEF-compatible
clients.
Filter TNEF MIME Decoder TNEF(1)