No problem. First the obligatory point. If you value the security of your web site, it is much better to use CPAN modules like CGI.pm to handle your CGI needs, something like Mail::Sendmail to handle the mailing, and something like MIME::Lite to create a nice MIME packet.

Right now though, you're trying to get something to work and probably won't be willing to wade through all that. So as an interim workaround, I would suggest inserting into the part of the program that prints out the Header (The first group of print MAIL "....."; (up to print MAIL "\n\n", which ends the header) the following (not tested, as I don't know Japanese...)

print MAIL "Content-Transfer-Encoding: ISO-2022-JP\n"; print MAIL "Content-Type: text/plain\n";
But be careful with this! You are taking input that the user has input onto a webform and then blithely sending it out to an external program (usually sendmail). Someone who knows you were doing that could try sending a code to end the sendmail input followed by a command to do something nasty to your server.

If you use Super Search you should be able to get a lot of information about CGI security and see how to patch this up better. Or, for an easier way, davorg, one of our resident monks, and the London Perl Mongers are working on easy programs to allow you to set this kind of thing up without giving away all the security. Look for it here: nms.


In reply to Re: Re: Re: cgi email Japanese contents scripting problem by mpolo
in thread cgi email Japanese contents scripting problem by stonemen

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.