Sponsored Content
Top Forums UNIX for Advanced & Expert Users Mutt for html body and multiple html & pdf attachments Post 302740231 by spacebar on Wednesday 5th of December 2012 10:18:59 PM
Old 12-05-2012
You need to supply the content type like below, this is a simple example of how it works for me in a perl script:

Code:
$mail_type='set content_type="text/html"'

$child_pid = open( MUTT,"|mutt -e ${mail_type} -e ${replyto_name} -e ${replyto_email_address} " .
                        "-s ${subject} -a ${attachment} ${emailrecip}" );
if ( not defined( $child_pid  ) ) {
  print "**Error: Could not open pipe to mutt -- additional error text\n";
  writelog ("ERR Could not open pipe to mutt -- additional error text");
  return 1;
}
# The $message variable has the embedded html
print MUTT $message;
unless (close MUTT) {
  print "**Error: Could not close pipe to mutt -- additional error text\n";
  writelog ("ERR Could not close pipe to mutt -- additional error text");
  return 1;
}


hth
 

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
MU-CFIND(1)						      General Commands Manual						       MU-CFIND(1)

NAME
mu_cfind - find contacts in the mu database and export them for use in other programs. SYNOPSIS
mu cfind [options] [<pattern>] DESCRIPTION
mu cfind is the mu command for finding contacts (name and e-mail address of people who were either sender or receiver of mail). There are different output formats available, for importing the contacts into other programs. SEARCHING CONTACTS
When you index your messages (see mu index), mu creates a list of unique e-mail addresses found and the accompanying name. In case the same e-mail address is used with different names, the most recent non-empty name is used. mu cfind starts a search for contacts that match a regular expression. For example: $ mu cfind '@gmail.com' would find all contacts with a gmail-address, while $ mu cfind Mary would find all contact with Mary in either name or e-mail address. If you do not specify any search expression, mu cfind will return the full list of contacts. The regular expressions are Perl-compatible (as per the PCRE-library). OPTIONS
--format=plain|mutt-alias|mutt-ab|wl|org-contact|bbdb|csv sets the output format to the given value. The following are available: | --format= | description | |-------------+-----------------------------------| | plain | default, simple list | | mutt-alias | mutt alias-format | | mutt-ab | mutt external address book format | | wl | wanderlust addressbook format | | org-contact | org-mode org-contact format | | bbdb | BBDB format | | csv | comma-separated values | RETURN VALUE
mu cfind returns 0 upon successful completion -- that is, at least one contact was found. Anything else leads to a non-zero return value, for example: | code | meaning | |------+--------------------------------| | 0 | ok | | 1 | general error | | 2 | no matches (for 'mu cfind') | INTEGRATION WITH MUTT
You can use mu cfind as an external address book server for mutt. For this to work, add the following to your muttrc: set query_command = "mu cfind --format=mutt-ab '%s'" Now, in mutt, you can easily search for e-mail address using the query-command, which is (by default) accessible by pressing Q. ENCODING
mu cfind output is encoded according to the current locale except for --format=bbdb. This is hard-coded to UTF-8, and as such specified in the output-file, so emacs/bbdb can handle it correctly without guessing. BUGS
Please report bugs if you find them at http://code.google.com/p/mu0/issues/list. AUTHOR
Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> SEE ALSO
mu(1) mu-index(1) mu-find(1) pcrepattern(3) User Manuals May 2011 MU-CFIND(1)
All times are GMT -4. The time now is 06:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy