Font change in unix while sending email


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Font change in unix while sending email
# 1  
Old 11-30-2010
Font change in unix while sending email

Hi,

I know that we would be require HTML to change the font and color of the text of the output, if we wnt to send that through the email.
But I have managed to get below code, can someone look into it and let me know if i can acheive my requirement through this kind of code:

Following can be used:
Code:
###################
## "style sheet" ##
 
my $ss_header = $mw -> fontCreate( -family => "Courier", -size => "14", -weight => "bold" );
my $ss_results_body = $mw->fontCreate(
-family => "screen",
-size => 12,
-weight => "normal"
);

Not sure, how to use above code in my script to change the font of the text to display in bold in the email. Any help on this would be much appreciated.

Thanks
Amit

---------- Post updated at 09:35 PM ---------- Previous update was at 05:27 PM ----------

Any one for help here?

Last edited by Scott; 12-01-2010 at 08:42 PM.. Reason: Code tags
# 2  
Old 12-01-2010
I guess it depends on the mail client. Is it html email or ???

If I wanted to send HTML email from the UNIX command batch world, I might write my own SMTP client, stealing my content clues from an HTML email saved as a flat file. SMTP is easy to do, using "telnet <mail_host> 25" or the equivalent. Maybe there is an HTML email client out there that can run in batch.
# 3  
Old 12-01-2010
No Not html email.
It is just a plain text email.
Now any inputs?
# 4  
Old 12-02-2010
Plain text is not bold, underlined, italic and has no color. You need rtf or html or the like to tune up your text. Man pages and old nroff/troff programs used to send backspace and repeat the character (sometime many times), which works somewhat on paper, but does nothing for a CRT.
Code:
$ man man|cat -vt|head
 
 m^Hm^Hm^Hma^Ha^Ha^Han^Hn^Hn^Hn(^H(^H(^H(1^H1^H1^H1)^H)^H)^H)                                                               m^Hm^Hm^Hma^Ha^Ha^Han^Hn^Hn^Hn(^H(^H(^H(1^H1^H1^H1)^H)^H)^H)
 
 
 N^HN^HN^HNA^HA^HA^HAM^HM^HM^HME^HE^HE^HE
      man - find manual information by keywords; print out a manual entry

# 5  
Old 12-02-2010
Quote:
Originally Posted by amit.mathur08
No Not html email.
It is just a plain text email.
Now any inputs?
Your email doesn't need to look like a web page if you use simple font tags in the email it can appear just like you want, try playing around with an on-line html editor and see if you can get a message format you like.


Eg:
Code:
 $ sendmail someone@fake.address.com <<EOF
To: someone@fake.address.com
Subject: Text message
Content-Type: text/html; charset="us-ascii"
<html>
<body>
<p>
<font size="5" face="Courier" color="blue">
This is a header
</font>
</p>
<font size="2" face="screen">
And some normal paragraph text.
</font>
</p>
</body>
</html>
EOF

This should look like this in the email:

This is a header
And some normal paragraph text.
# 6  
Old 12-02-2010
how can i connect this HTML code with my unix script?
Can i write this code in my unix script?
I am using mail -s command to send an email to mailbox.
# 7  
Old 12-02-2010
Yes, to get past into the headers usually means leaving mail behind. You might be able to set the content type to html in "mail -s" or "mailx -s" by putting a linefeed after the subject and then any header lines you want. I have kludged mailx this way for priority on Solaris (where mail has no -s). Otherwise, using sendmail, or telnet to a server, allows you to send the raw mail formats.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sending email in UNIX

can you tell me what is the syntax if I need to keep someone in cc with the below email. mailx -s "shell script completed successfully" arun@gmail.com < /dev/null (4 Replies)
Discussion started by: ramkumar15
4 Replies

2. Shell Programming and Scripting

Sending mail from UNIX in courier font

Need assistance . I have a cvs file which i changed to html file but when i try to send mail to outlook its indent goes wrong. any idea is appreciated . below are some commands i tried using Converting csv to html #!/bin/sh nawk 'BEGIN{ FS="," print "MIME-Version: 1.0" print ... (7 Replies)
Discussion started by: ajayram_arya
7 Replies

3. UNIX for Advanced & Expert Users

Sending email from UNIX server

Hi, I am trying to send an output of a script in an email. I want to know if there is a way to modify the senders email not as my username on the host server but as one of the sender preset on outlook. I was using cat email.log | /bin/mailx -c cclist -r myemailid -s "subject" tolistids ... (4 Replies)
Discussion started by: gopajitmalakar
4 Replies

4. UNIX for Dummies Questions & Answers

Sending formatted email from unix.

Hi All, I need to send email from unix in the below format. But the email body is coming all in one single line. How do i format the below text, so that the body of email is properly formatted. Please help. TO: <email id> CC: <none> BCC: <none> Subject: Support: file GENERATION is... (3 Replies)
Discussion started by: abhi_123
3 Replies

5. Shell Programming and Scripting

Sending email from a unix program

Hi, I have create a unix prog file to validate data and send out an email. Below is the command used to send out email in the program. But it is not triggering the email. Please advice on this. (echo ${MESSAGE};uuencode "$FCP_OUT" "ERROR_REPORT.csv"; uuencode "$VALIDATION_RPT"... (1 Reply)
Discussion started by: contactsmrajesh
1 Replies

6. Shell Programming and Scripting

Sending email from Unix

I am using the following syntax to send an e-mail from Unix (Sun OS). mail -s "hello" abc@yahoo.com But, when I click enter after typing this command, its not exiting and after a while when I give ctrl+c it creates a dead.letter file in my $HOME dir. Can anyone please tell me, if I have to... (7 Replies)
Discussion started by: rajesh8s
7 Replies

7. HP-UX

Sending Unix files as attachments in an email

Hi, I am executing the following command in order to send a file as an attachment: mailx -s "Subject" emailID@xyz.com < Testfile.txt Instead of attaching the file Testfile.txt, it is writing the contents of the file in the email message body. Please advise on how I can send the file as an... (7 Replies)
Discussion started by: sangharsh
7 Replies

8. HP-UX

How to change font and colour in mail sent from Unix

Dear All, We have following code to send mails from unix to users. We want to see few sentences of mail in bold font or to hightlight few lines in different colours. Could you please let me know how can we do it in function construct_body. ... (3 Replies)
Discussion started by: yogichavan
3 Replies

9. Shell Programming and Scripting

How to change the font colour in unix ?

Could you pls tell me how to change the font colour in unix ? What is the syntax ? (3 Replies)
Discussion started by: sars
3 Replies

10. Shell Programming and Scripting

sending email in unix. need help!

how can I send an email in UNIX, attach a file and cc a receipient? i use the command below to attach a file (this works): uuencode path/filename filename | mailx -s "subject" addr@host.com here is how i cc a receipient (this also works): i have a file named cc.lis and contains: Hello... (2 Replies)
Discussion started by: tads98
2 Replies
Login or Register to Ask a Question