Re: italicize an email message
by jasonk (Parson) on Apr 09, 2003 at 14:32 UTC
|
You have to convert it to some form of document that includes fonts, because email is ascii-based and has no concept of italics.
| We're not surrounded, we're in a target-rich environment! |
|---|
| [reply] |
Re: italicize an email message
by Tomte (Priest) on Apr 09, 2003 at 14:43 UTC
|
depending on the recipient and theyre internet-background or geekiness: using slashes to italicize a word in an ascii message (like /so/) could be understood (and asterisk to signal *bold*)...
these were the days...
regards,
tomte
Hlade's Law:
If you have a difficult task, give it to a lazy person --
they will find an easier way to do it.
| [reply] |
Re: italicize an email message
by Improv (Pilgrim) on Apr 09, 2003 at 14:38 UTC
|
Depending on your email client, you might just cut'n'paste
it into a MIME/HTML capable mail client, and then highlight
the word in there and click on the italics button.
Of course, a lot of people, myself included, dislike recieving
HTML mail.
There are various modules that you might use to do this
programmatically. One way might be to just set the mime type
to text/html using the provided APIs, enclose the message text in a <PRE>
tag, and then enclose the needed word in <I>WORD<\I>
You might find these particular modules helpful:
MIME::Body
MIME::Light
MIME::Entity
MIME::Light will probably be the most useful.
| [reply] |
Re: italicize an email message
by Coplan (Pilgrim) on Apr 09, 2003 at 16:37 UTC
|
Just one word? Regexp is your solution. I assume you're using HTML output?
open(FILE, "file.txt") or die "$!";
while (<FILE>) {
$_ =~ /$word/<em>$word</em>/;
}
print $_;
close(FILE);
Disclaimer: This code hasn't been tested!
--Coplan
| [reply] [d/l] |
|
|
perhaps $_ =~ /$word/<em>$word</em>/; should be $_ =~ s/$word/<em>$word</em>/;
feanor_269
| [reply] [d/l] [select] |
|
|
Well ... it should be $_ =~ s/\Q$word\E/<em>$word</em>/g;
Jenda
Always code as if the guy who ends up maintaining your code
will be a violent psychopath who knows where you live.
-- Rick Osborne
Edit by castaway: Closed small tag in signature
| [reply] [d/l] |
|
|
I'm not using HTML as my output....I'm not sure exactly how or why I should? Let me explain a little better my problem. There is this mass email that has to be sent out to various people within my company. The message I have to send has a word that needs to be italicized. I am using NET::SMTP to send the email so the message is just text. thanks again
| [reply] |
|
|
That's the point others are trying to make: you can't use italics in a plain text message. To do so, you either need HTML, or RTF, or something similar. You can send a multipart email using MIME, but again, the plain text portion will not have any font formatting, only the HTML or RTF portion.
| [reply] |