Sponsored Content
Full Discussion: shell send html email
Top Forums Shell Programming and Scripting shell send html email Post 302236608 by era on Tuesday 16th of September 2008 02:03:24 AM
Old 09-16-2008
Strictly speaking you should also have MIME-Version and Content-Transfer-Encoding headers. MIME-Version is simply 1.0, there has never been any other version; for Content-Transfer-Encoding, 7bit is appropriate if the content is plain 7-bit ASCII text with no long lines (longer than 1024 characters IIRC). (If it's not plain 7-bit ASCII you should also define the character set in Content-Type.)

Some versions of cat will accept standard input as an argument, so you can say

Code:
cat - /path/to/file <<HERE | sendmail -oi -t
From: ${MAILFROM}
To: ${MAILTO}
Subject: Same subject
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
MIME-Version: 1.0

HERE

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to send message in html format using shell script

I want to send email message in html format using unix shell script. I use sendEmail command in my script to send email message. The syntaxt of the sendEmail command is as follows: $sendEmail -f <email> -t <email> -u $subject -s smtpserver:port -o message-file=html I should be able to... (1 Reply)
Discussion started by: baps
1 Replies

2. Shell Programming and Scripting

Send Email using Korn Shell

Hi All, I need assistance is sending email out using korn shell Steps, 1- Count number of records in database. 2- if count is more than 2000 3- send email to user else if less then 1999 exit out. Here is my script and is not exiting out and need to press .DOT and Enter command to... (2 Replies)
Discussion started by: atlurip
2 Replies

3. Shell Programming and Scripting

How to send email through shell script

Hi All, I am new to the unix , i have to deliver one script very urgently I have to write a shell script where i have i want to send email to specific email id in this script i want FROM to be parameterized and stored in a variable TO to be parameterized and stored in a variable... (3 Replies)
Discussion started by: nileshbhawsar
3 Replies

4. Shell Programming and Scripting

Script to send email after comparing the folder permissions to a certain permission & send email

Hello , I am trying to write a unix shell script to compare folder permission to say drwxr-x-wx and then send an email to my id in case the folders don't have the drwxr-x-wx permissions set for them . I have been trying to come up with a script for few days now , pls help me:( (2 Replies)
Discussion started by: nairshar
2 Replies

5. UNIX for Advanced & Expert Users

How to send email as HTML format with attachment ?

hi.. Could somebody help me how to sent an attachment using sendmail command and the content is HTML format ?. Below is my code to sent the email as HTML but i do not know how to sent the attachment, please help me To: "BAHARIN HASAN"<baharin.hasan@gmail.com> from: "DATAONE SDN... (4 Replies)
Discussion started by: bh_hensem
4 Replies

6. Shell Programming and Scripting

how to send html email from shell script

This is my below script which is working fine as it send only plain text email. So My question is- How can I modify my below script to send this as an HTML formatted email? I want to show the text color of this expression `(echo "100*$TEST2/$TEST1" | bc -l)` as `RED` in an email and that can be... (3 Replies)
Discussion started by: raihan26
3 Replies

7. 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

8. Shell Programming and Scripting

How to send email HTML + PDF attachment?

I am attempting to write a script where I can pass in parameters ( to , from, the location of a pdf attachment ) and send an email that has HTML for the body content and a PDF as an attachment. I have failed to achieve this with sendmail and mutt. I recently found this. If there are any... (2 Replies)
Discussion started by: jvsrvcs
2 Replies

9. Shell Programming and Scripting

HTML table in email body using C Shell

I am using Sun Solaris ver. 5.10 and trying to send an HTML table in email body using mail command in C shell script. I tried following commands:- #1 mail -m "MIME-Version: 1.0;Content-type:text/html;charset=UTF-8" receiver@mail.com < file.html #2 mail -m "Content-type: text/html;" -s "This... (4 Replies)
Discussion started by: jnrohit2k
4 Replies

10. HP-UX

Unable to send attachment with html tables in UNIX shell script

Heyy, any help would be grateful.... LOOKING FOR THE WAYS TO SEND AN EMAIL WITH ATTACHMENT & HTML TABLES IN BODY THROUGH SHELL SCRIPT (LINUX)..NOT SURE, IF WE HAVE ANY INBUILT HTML TAG OR UNIX COMMAND TO SEND THE ATTACHMENTS. KINDLY HELP below is small script posted for our understanding..... (2 Replies)
Discussion started by: Harsha Vardhan
2 Replies
MIME::Field::ContType(3)				User Contributed Perl Documentation				  MIME::Field::ContType(3)

NAME
MIME::Field::ContType - a "Content-type" field DESCRIPTION
A subclass of Mail::Field. Don't use this class directly... its name may change in the future! Instead, ask Mail::Field for new instances based on the field name! SYNOPSIS
use Mail::Field; use MIME::Head; # Create an instance from some text: $field = Mail::Field->new('Content-type', 'text/HTML; charset="US-ASCII"'); # Get the MIME type, like 'text/plain' or 'x-foobar'. # Returns 'text/plain' as default, as per RFC 2045: my ($type, $subtype) = split('/', $field->type); # Get generic information: print $field->name; # Get information related to "message" type: if ($type eq 'message') { print $field->id; print $field->number; print $field->total; } # Get information related to "multipart" type: if ($type eq 'multipart') { print $field->boundary; # the basic value, fixed up print $field->multipart_boundary; # empty if not a multipart message! } # Get information related to "text" type: if ($type eq 'text') { print $field->charset; # returns 'us-ascii' as default } PUBLIC INTERFACE
boundary Return the boundary field. The boundary is returned exactly as given in the "Content-type:" field; that is, the leading double-hyphen ("--") is not prepended. (Well, almost exactly... from RFC 2046: (If a boundary appears to end with white space, the white space must be presumed to have been added by a gateway, and must be deleted.) so we oblige and remove any trailing spaces.) Returns the empty string if there is no boundary, or if the boundary is illegal (e.g., if it is empty after all trailing whitespace has been removed). multipart_boundary Like "boundary()", except that this will also return the empty string if the message is not a multipart message. In other words, there's an automatic sanity check. type Try real hard to determine the content type (e.g., "text/plain", "image/gif", "x-weird-type", which is returned in all-lowercase. A happy thing: the following code will work just as you would want, even if there's no subtype (as in "x-weird-type")... in such a case, the $subtype would simply be the empty string: ($type, $subtype) = split('/', $head->mime_type); If the content-type information is missing, it defaults to "text/plain", as per RFC 2045: Default RFC 2822 messages are typed by this protocol as plain text in the US-ASCII character set, which can be explicitly specified as "Content-type: text/plain; charset=us-ascii". If no Content-Type is specified, this default is assumed. Note: under the "be liberal in what we accept" principle, this routine no longer syntax-checks the content type. If it ain't empty, just downcase and return it. NOTES
Since nearly all (if not all) parameters must have non-empty values to be considered valid, we just return the empty string to signify missing fields. If you need to get the real underlying value, use the inherited "param()" method (which returns undef if the parameter is missing). SEE ALSO
MIME::Field::ParamVal, Mail::Field AUTHOR
Eryq (eryq@zeegee.com), ZeeGee Software Inc (http://www.zeegee.com). David F. Skoll (dfs@roaringpenguin.com) http://www.roaringpenguin.com perl v5.18.2 2013-11-14 MIME::Field::ContType(3)
All times are GMT -4. The time now is 01:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy