Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Bold text in Bash and send mail Post 303042590 by lpoolfc on Tuesday 31st of December 2019 12:25:00 PM
Old 12-31-2019
Bold text in Bash and send mail

I have a sample script here I want to bold the word BOLD in the text and send through email. Tried several ways but not seems to working.
Code:
    
    BODY="Hello. I want to BOLD this"
    {
     echo "From: from@gmail.com"
     echo "To: to@gmail.com"
     echo "Subject: Texting"
     echo "X-Mailer: htmlmail" $VERSION
     echo "Mime-Version: 1.0"
     echo "Content-Type: text/html; charset=US-ASCII"
     print "<html><FONT COLOR=BLACK FACE="Geneva,Arial"SIZE=8><body>${BODY} </body>"

    print "<html><FONT COLOR=BLACK FACE="Geneva,Arial"SIZE=10> ${BODY} </html>"
    } | /usr/sbin/sendmail -t

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Send text file to mail

I have a utility that opens a telnet session and allows me to execute commands through a script. The utility allows me to output to a text file whatever is outputted to screen. This utility runs from a DOS prompt in Windows 95/98, NT or 2000. How can I mail text file this to a certain user. I... (2 Replies)
Discussion started by: petrosi
2 Replies

2. Shell Programming and Scripting

Send an attachment and html text both in the same mail

Hi all, I am working on UNIX (Solaris28). I would like to send an email in which the body will be in html format and, in the same mail, a xls file has to be attached. I have tried this: the file is correctly attached but the body comes as html source and not formatted. If I do not attach the... (4 Replies)
Discussion started by: stefan.yu
4 Replies

3. UNIX and Linux Applications

Bold characters in mail

I sh, I have bold characters in a file and I want to mail file to an ID. $cat file Incorrect or invalid external email IDs in TO and CC list for email_rules: If I pass this file to mailx $ cat file | mailx -s "hi" abc@xyz.com What I get in mail is  (8 Replies)
Discussion started by: hemangi13
8 Replies

4. Shell Programming and Scripting

How can i send mail to multiple addresses in same domain in bash?

Suppose i have a txt file that is the list of the addresses,something like: lala0045 john james lala0234 george james and i want to send an email to lala0045@blabla.com and lala0234@blabla.com,the same domain...what is the exact syntax i should use in my script? there is a command... (10 Replies)
Discussion started by: bashuser2
10 Replies

5. Shell Programming and Scripting

Send mail with rich text / HTML with image

Hi, Is it possible to send mail from my HP-Ux system with images, rich text? I would like to program in such a way that I have my company's logo(.jpg) image attached in the mail geeting triggered. I would like to send a rich text/HTML email instead of plain text mail to the recipients. Is it... (2 Replies)
Discussion started by: rythym05
2 Replies

6. Shell Programming and Scripting

Send a mail to IDs listed in a text file

I have a list of mail ids in text file and want a ksh script that reads this text file and sends a mail to all mail ids with same subject line and content. I am using UX-HP machine and KSH. Thanks for help in advance! (5 Replies)
Discussion started by: Sriranga
5 Replies

7. Shell Programming and Scripting

How to send colorful text and attachment to mail

Hi, I want to send color text as body of mail with multiple attachments.How to do this?I used sendmailcommand but this command fails for multiple attachments.Give me some solution on this. :wall: (0 Replies)
Discussion started by: AhmedLakadkutta
0 Replies

8. Shell Programming and Scripting

send text mail to windows

Hi I have the following 'atd' batch script to send mail to a windows (outlook) system: .... .... LESSOPEN=\|/usr/bin/lesspipe.sh\ %s; export LESSOPEN G_BROKEN_FILENAMES=1; export G_BROKEN_FILENAMES cd /root/bin || { echo 'Execution directory inaccessible' >&2 exit 1 }... (3 Replies)
Discussion started by: AdminLew
3 Replies

9. UNIX for Beginners Questions & Answers

Shell script to compare text and send a mail

Hello, Somebody can help me to develop a script for the below requirement I have a 3 files in a directory which was dynamically changed everyday basis. I need a script to fetch the 1pattern of strings in each file. if the three matching pattern is same send a mail with subject as success else... (1 Reply)
Discussion started by: MATHANKUMAR
1 Replies

10. UNIX for Beginners Questions & Answers

Manipulate condition to send mail based on output text in file

Hi All, I have a working script as below. echo "Files loaded with $(cat /var/tmp/script.X1.out)" | mail -s "Files loaded with return code" mailid This script takes the output from script.X1.out file and appends the text "Files loaded with return code" and sends the email. Now what I want... (5 Replies)
Discussion started by: midhun3108
5 Replies
MHMAIL(1)							     [nmh-1.5]								 MHMAIL(1)

NAME
mhmail - send or read mail SYNOPSIS
mhmail [addrs ...] [-body text] [-cc addrs ...] [-from addr] [-subject subject] [-version] [-help] DESCRIPTION
mhmail is intended as a replacement for the standard Berkeley mail program (mail or mailx), which is compatible with nmh. This program is intended for the use of programs such as cron, which expect to send mail automatically to various users. It is also used by various nmh commands to mail various error notifications. Although mhmail can be used interactively, it is recommended that comp and send be used instead to send messages. When invoked without arguments, it simply invokes inc to incorporate new messages from the user's maildrop. When one or more users is specified, a message is read from the standard input and spooled to a temporary file. mhmail then invokes post with the name of the tempo- rary file as its argument to deliver the message to the specified user. The -subject subject switch can be used to specify the "Subject:" field of the message. By default, mhmail will read the message to be sent from the standard input. You can specify the text of the message at the command line with the -body text switch. If the standard input has zero length, mhmail will not send the message. You can use the switch -body "" to force an empty message. Normally, addresses appearing as arguments are put in the "To:" field. If the -cc switch is used, all addresses following it are placed in the "cc:" field. By using -from addr, you can specify the "From:" header of the draft. Naturally, post will fill-in the "Sender:" header correctly. FILES
/usr/bin/mh/inc Program to incorporate maildrop into folder /usr/lib/mh/post Program to deliver a message /tmp/mhmail* Temporary copy of message SEE ALSO
inc(1), post(8) DEFAULTS
None CONTEXT
If inc is invoked, then inc's context changes occur. MH.6.8 11 June 2012 MHMAIL(1)
All times are GMT -4. The time now is 06:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy