Sponsored Content
Full Discussion: shell send html email
Top Forums Shell Programming and Scripting shell send html email Post 302235765 by Ikon on Friday 12th of September 2008 07:04:41 PM
Old 09-12-2008
shell send html email

I know how to send an email with sendmail in a shell script.

I know how to send an email with an attachment in a script.



But im trying to send an email and need to set Content-Type to text/html and insert a file as the body and not attachment.

Send email with file as attachment:
Code:
#!/bin/bash
 
ATTFILE=$1
ATTNAME=$1
MAILTO=me@home.com
MAILFROM=someone@mail.com
 
( cat <<HERE; uuencode "${ATTFILE}" "${ATTNAME}" ) | sendmail -oi -t
From: ${MAILFROM}
To: ${MAILTO}
Subject: Requested file attached $ATTNAME
 
HERE

How can I change this to put the ATTFILE directly in the body?

Im pretty sure it will take Content-Type like this:
Code:
.
.
From: ${MAILFROM}
To: ${MAILTO}
Content-Type: text/html
.
.

Thanks....
 

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

NAME
pius - PGP Individual UID Signer SYNOPSIS
pius [options] -s <signer-keyid> <keyid> [<keyid> ...] pius [options] -A -r <keyring-path> -s <signer-keyid> DESCRIPTION
pius The PGP Individual UID Signer (PIUS) is a tool for individually signing all of the UIDs on a set of keys and encrypt-emailing each one to it's respective email address. This drastically reduces the time and errors involved in signing keys after a keysigning party. OPTIONS
--version show program's version number and exit -h or --help show this help message and exit -a or --use-agent Use pgp-agent instead of letting gpg prompt the user or every UID. [default: false] -A or --all-keys Sign all keys on the keyring. Requires -r. -b PATH or --gpg-path=PATH Path to gpg binary. [default: /usr/bin/gpg] -e or --encrypt-outfiles Encrypt output files with respective keys. -d or --debug Enable debugging output. -H HOSTNAME or --mail-host Hostname of SMTP server. [default: localhost] -i or --interactive Use the pexpect module for signing and drop to the gpg shell for entering the passphrase. [default: false] -I or --import Also import the unsigned keys from the keyring into the default keyring. Ignored if -r is not specified, or if it's the same as the default keyring. -m EMAIL or --mail Email the encrypted, signed keys to the respective email addresses. EMAIL is the address to send from. See also -H and -p. -M FILE or --mail-text Use the text in FILE as the body of email when sending out emails instead of the default text. To see the default text use --print- default-email. Requires -m. -n EMAIL or --override-email Rather than send to the user, send to this address. Mostly useful for debugging. -o OUTDIR or --out-dir Directory to put signed keys in. [default: /tmp/pius_out] -O or --no-pgp-mime Do not use PGP/Mime when sending email. -p or --cache-passphrase Cache private key passphrase in memory and provide it to gpg instead of letting gpg prompt the user for every UID. [default: true] -P PORT or --mail-port Port of SMTP server. [default: 25] -r KEYRING or --keyring The keyring to use. Be sure to specify full or relative path. Just a filename will cause GPG to assume relative to ~/.gnupg. [default: ~/.gnupg/pubring.gpg] -s SIGNER or --signer The keyid to sign with (required). -S or --mail-tls Use STARTTLS when talking to the SMTP server. -t TMP_DIR or --tmp-dir Directory to put temporary stuff in. [default: /tmp/pius_tmp] -T or --print-default-email Print the default email. -u USER or --mail-user Authenticate to the SMTP server, and use username USER. You will be prompted for the password. Implies -S. -v or --verbose Be more verbose. AUTHOR
PIUS was written by Phil Dibowitz <phil@ipom.com> This manual page was written by Luke Cycon <lcycon@gmail.com>, for the Debian project (but may be used by others). MARCH 2010 PIUS(1)
All times are GMT -4. The time now is 09:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy