I'm a real newbie and would appreciate any help. I'm trying to modify a script that parses the HTML tags from a page and emails selected content using sendmail.
My problem is that the content is Spanish and the special characters (ñ, etc.) are not coming through in the email, MS Entourage at least, but are showing up as ~ or / or ^. I'm trying to substitute the characters for the HTML encodings and have the ISO set to 8859-1, but I must be doing something wrong. Any ideas?
The code setting up the email looks like:
open(MAIL,"|$G{MailProgram}");
print MAIL "To: $In{toemail}\n";
print MAIL "From: \"$In{name}\" \<$In{fromemail}\>\n";
print MAIL "X-IP_Address: $ENV{REMOTE_ADDR}\n";
print MAIL "MIME-version: 1.0\n";
print MAIL "Content-Type: text/plain; charset=ISO-8859-1\n";
print MAIL "Subject: Articulo\n\n";
print MAIL "$In{message}\n\n";
print MAIL "$In{name} le manda este articulo\n\n";
$printline = 0;
for(@L)
{
if($_ =~ /BEGIN mailer/) { $printline = 1; next; }
next unless $printline;
if($_ =~ /END mailer/) { $printline = 0; next; }
$_ =~ s/<.*?>//g;
$_ =~ s/&amp;ntilde;/ñ/g;
...and so on with the other characters...
print MAIL $_;
}
close MAIL;
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.