Sponsored Content
Top Forums UNIX for Advanced & Expert Users Mutt for html body and multiple html & pdf attachments Post 302740225 by raggmopp on Wednesday 5th of December 2012 09:52:55 PM
Old 12-05-2012
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;

Code:
system("/usr/bin/mutt -s \"Support\" -- \"$cust\" < $body");

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;
Code:
system("/usr/bin/mutt -e \"my_hdr Content-Type:text/html\" -s \"Support\" @attach -- \"$cust\" < $body");

.

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.

Many thanks!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl - Convert html to pdf - PDF::FromHTML

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)
Discussion started by: DILEEP410
2 Replies

2. Shell Programming and Scripting

Sendmail with html attachment and html body

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)
Discussion started by: sol_nov
1 Replies

3. Red Hat

Send HTML body and HTML attachment using MUTT command

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)
Discussion started by: vickramshetty
2 Replies

4. UNIX for Advanced & Expert Users

Email with multiple attachments & HTML body

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)
Discussion started by: BHM
12 Replies

5. UNIX for Advanced & Expert Users

HTML and attachment using mutt command

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)
Discussion started by: arukuku
1 Replies

6. Shell Programming and Scripting

Multiple attachments using mutt

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)
Discussion started by: Shaishav Shah
8 Replies

7. Shell Programming and Scripting

Issue to attachment with HTML body

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)
Discussion started by: Jewel
4 Replies

8. Shell Programming and Scripting

Mail sending with multiple attachement(pdf and csv) with html content from Linux

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)
Discussion started by: dholea
5 Replies

9. Shell Programming and Scripting

SQL query output convert to HTML & send as email body

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)
Discussion started by: jagadeeshn04
3 Replies

10. Shell Programming and Scripting

Attach multiple index.html file using mutt

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
MojoMojo::Controller::Attachment(3pm)			User Contributed Perl Documentation		     MojoMojo::Controller::Attachment(3pm)

NAME
MojoMojo::Controller::Attachment - Attachment controller DESCRIPTION
MojoMojo supports attaching files to nodes. This controller handles administration and serving of these assets. ACTIONS
auth Return whether the current user has attachment manipulation rights (upload/delete). unauthorized Private action to return a 403 with an explanatory template. default Private action to return a 404 not found page. attachments Main attachment screen. Handles uploading of new attachments. list Display the list of attachments if the user has view permissions. template: attachments/list.tt plain_upload Upload feature that uses the traditional upload technique. check_file Check if the file(s) uploaded could be added to the Attachment table. flash_upload Upload feature that uses flash attachment Find and stash an attachment. defaultaction Set the default action for an attachment which is forwarding to a view. view Render the attachment in the browser ("Content-Disposition: inline"), with caching for 1 day. download Forwards to "view" then forces the attachment to be downloaded ("Content-Disposition: attachment") and disables caching. thumb Thumb action for attachments. Makes 100x100px thumbnails. inline Show 800x600 inline versions of photo attachments. delete Delete the attachment from this node. Will leave the original file on the file system but delete its thumbnail and inline versions. AUTHOR
Marcus Ramberg "marcus@nordaaker.com" LICENSE
This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2010-05-23 MojoMojo::Controller::Attachment(3pm)
All times are GMT -4. The time now is 10:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy