Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

"Pretty" Emails
Hi all,

I am currently using the MIME::Lite module to send Emails,
However my boss wants me to line the tables up better and generally =
pretty it up
A bit (bold) etc.
I can't use HTML as our company is still using NT4 Outlook.
Any ideas on a possible formatting module I can use or any suggestions =
at all=20
Would be much appreciated.


Cheers
Mick H


Report this thread to moderator Post Follow-up to this message
Old Post
Mick I Hawkes
12-21-04 08:55 AM


Re: "Pretty" Emails

Hawkes, Mick I wrote:
> Hi all,

Hello,

> I am currently using the MIME::Lite module to send Emails,
> However my boss wants me to line the tables up better and generally pretty
 it up
> A bit (bold) etc.
>
> I can't use HTML as our company is still using NT4 Outlook.

Your boss wants you to format text without using the world's most
compatible and widely used formatting language??

You can "line up tables better" by formatting your plain text maybe with
printf or sprintf (perldoc -f sprinft and perldoc -f printf) but you
can't make plain text "(bold) etc" without some markup language and
since 99.999999999999 % of mail clients/computers have some form of html
interpreter then html is your best bet.

> Any ideas on a possible formatting module I can use or any suggestions at all[/col
or]

1) Fire your boss, he sounds kinda dumb :)

2) forget using anything else besides html to really format your
messages, anything else will be plain text or some formatting that is
not usable by 99.999999999% of mail clients

3) Kick your boss in the shin's for being so lame

4) send him to http://google.com/search?q=What+is+an+email and he will
find that an email is a bunch of plain text that is formatted into a
header and body section with the body section containing (except for
morons that send html only emails) a plain text part, maybe an html
part, and attached files, if any, encoded in base64

5) Here's a gem: use Mail::Sender its way sexxy and lets you do plain
text and html parts and attachments very very easy, just my .02

HTH :)

Lee.M - JupiterHost.Net

Report this thread to moderator Post Follow-up to this message
Old Post
JupiterHost.Net
12-21-04 08:55 AM


Re: "Pretty" Emails
On Mon, 20 Dec 2004, JupiterHost.Net wrote:

> Hawkes, Mick I wrote:
> 
>
> Your boss wants you to format text without using the world's most
> compatible and widely used formatting language??

...which should never, ever have been added to email.

This is offtopic, but let's be honest, HTML is a lousy formatting
language, and adding it to email caused all kinds of problems, from
myriad security issues that never existed before, to enabling spammers
to keep track of who is reading their nocturnal emissions.

Any company that, as a policy, wants to ban HTML mail is okay by me.

So. Text formatting options.

* Use Perl's built-in functionality. This article takes a look at how
this is done today with Perl5, and how it will be done in the future
with Perl6:

<http://www.perl.com/pub/a/2004/02/27/exegesis7.html>

* Use the Text::Template module, if it isn't overkill:

<http://search.cpan.org/dist/Text-Te...ext/Template.pm>

These approaches can handle basic table layouts, but not text styling:
boldface, italics, etc. *But*, some people can _make do_ /without/ that
with text tricks that approximate *bold*, /italics/, and _underlining_.
(I think Word will even take that and apply the actual styles, but I
don't use Word because of such "helpful" things. Some people like it.)

If you really need that kind of formatting, consider using either
attachments (a good PDF will look better than HTML anyway, but you can
also just attach an Office document or whatever) or set up an intranet
server where people can post documents and send each other URLs to them.


--
Chris Devers

Report this thread to moderator Post Follow-up to this message
Old Post
Chris Devers
12-21-04 08:57 PM


Re: "Pretty" Emails
>>Your boss wants you to format text without using the world's most 
>
>
> ...which should never, ever have been added to email.

Good point :)

> This is offtopic, but let's be honest, HTML is a lousy formatting
> language, and adding it to email caused all kinds of problems, from
> myriad security issues that never existed before, to enabling spammers
> to keep track of who is reading their nocturnal emissions.
>

> Any company that, as a policy, wants to ban HTML mail is okay by me.

I agree 100%, my beef was with wanting bold etc without using html or
other ML.

> So. Text formatting options.
>
>  * Use Perl's built-in functionality. This article takes a look at how
>    this is done today with Perl5, and how it will be done in the future
>    with Perl6:
>
>      <http://www.perl.com/pub/a/2004/02/27/exegesis7.html>
>
>  * Use the Text::Template module, if it isn't overkill:
>
>      <http://search.cpan.org/dist/Text-Te...ext/Template.pm>
>
> These approaches can handle basic table layouts, but not text styling:
> boldface, italics, etc. *But*, some people can _make do_ /without/ that
> with text tricks that approximate *bold*, /italics/, and _underlining_.
> (I think Word will even take that and apply the actual styles, but I
> don't use Word because of such "helpful" things. Some people like it.)

Good ideas! In my experience most bosses/users are to clueless to use
even such a simple Markup language as the */ and _

> If you really need that kind of formatting, consider using either
> attachments (a good PDF will look better than HTML anyway, but you can

I think the document sharing idea is probably the way to go, generate a
pdf and email it as an aattachment, then it can look as pretty as you
want, will look the exact same for everyone, *and* some mail clients
will display pdfs inline so they may not even need to open it, which
would be  (I think Mozilla's mail client and Mac's Mail do this).

(I do this with certain contracts and legal docs, generate the html for
them with their custom content and create a pdf out of that html code
with Perl using htmldoc, there are other modules available to make pdf's
just never tried them ;p)

> also just attach an Office document or whatever) or set up an intranet
> server where people can post documents and send each other URLs to them.

Report this thread to moderator Post Follow-up to this message
Old Post
JupiterHost.Net
12-21-04 08:57 PM


RE: "Pretty" Emails
Thanks Chris,
Went to the exegesis7 link and that format will do though I do have some =
questions about it
(I am a newbie to Perl after all :-))

from the site

So, whereas in Perl 5 we might write:

# Perl 5 code...

our ($name, $age, $ID, $comments);

format STDOUT
=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=20
| NAME     |    AGE     | ID NUMBER |
|----------+------------+-----------|
| @<<<<<<< | @||||||||| | @>>>>>>>> |
$name,     $age,        $ID,
=
 |=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D|
| COMMENTS                          |
|-----------------------------------|
| ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |~~
$comments,
=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

Report this thread to moderator Post Follow-up to this message
Old Post
Mick I Hawkes
12-22-04 08:56 AM


Re: "Pretty" Emails
Hawkes, Mick I wrote:
> Went to the exegesis7 link and that format will do though I do have some q
uestions about it
> (I am a newbie to Perl after all :-))
>
> from the site
>
> So, whereas in Perl 5 we might write:
>
>     # Perl 5 code...
>
>     our ($name, $age, $ID, $comments);
>
>     format STDOUT
>      ===================================
>     | NAME     |    AGE     | ID NUMBER |
>     |----------+------------+-----------|
>     | @<<<<<<< | @||||||||| | @>>>>>>>> |
>       $name,     $age,        $ID,
>     |===================================|
>     | COMMENTS                          |
>     |-----------------------------------|
>     | ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |~~
>       $comments,
>      ===================================
>     .
>
>     write STDOUT;
>
> how do I convert this from writing to STOUT to writing to a string. Is it 
just
> format $mystring ?
>
> up until now I have only been using \t and \n. I have no clue what Q<|^ and ~ do![
/color]

perldoc perlform


John
--
use Perl;
program
fulfillment

Report this thread to moderator Post Follow-up to this message
Old Post
John W. Krahn
12-22-04 01:57 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL Beginners archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 08:02 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.