Hello People,

I am inputting russian / cyrillic into an e-mail form / program I wrote and when it arrives, part of the output is mangled for the same russian / cyrillic input. For example the person inputs their name (Увеличение массы мозга) in russian / cyrillic and when the e-mail arrives the name is displayed properly in the body of the e-mail but not in the attached jpg file or the subject of the e-mail. All three are using the name that was input.

Here is the code:
#================================================================ #- Send image #================================================================ # sub send_image { my $message_body; # Adjust sender, recipient and your SMTP mailhost my $from_address = $from; my $to_address = $email; # Adjust subject and body message if ( $testmode ) { $message_body = "Thank you for performing the transfer test. I +t's good until <b>$msg_body_expdate</b>.<br /><br />Visit <a href=\"h +ttp://www./specialoffer\">http://www./specialoffer</a> now to take ad +vantage of this exciting special one week offer of 10% off<br /><br / +>"; } else { $message_body = "Attached is the chi card you ordered. It's go +od until <b>$msg_body_expdate</b>."; } my $subject = "Chi-Card delivery service"; # Create the multipart container my $msg = MIME::Lite->new ( From => $from_address, To => $to_address, BCC => $bcc, Subject => $subject, Type =>'multipart/mixed' ) or die "Error creating multipart cont +ainer: $!\n"; # Add the text message part $msg->attach ( Type => 'text/html', Data => qq{ $message_body } ) or die "Error adding the text message part: $!\n"; # Add the excel file $msg->attach ( Type => 'image/jpeg', #Encodxing => 'base64', Path => $chicardcustomed, Filename => $filename, Disposition => 'attachment' ) or die "Error adding $chicardcustomed: $!\n"; # Now send $msg->send("sendmail") or die "Error e-mailing: $filename.\n"; } #================================================================ #- Send info #================================================================ # sub send_info { # Adjust sender, recipient and your SMTP mailhost my $from_address = $from; my $to_address = $infoemail; # Adjust subject and body message my $message_body = "<h2>The following visitor requested informatio +n.</h2><b>Name:</b> $string<br><b>E-mail:</b> $email<br>"; my $subject = "$string is requesting information."; # Create the multipart container my $msg = MIME::Lite->new ( From => $from_address, To => $to_address, BCC => $bcc, Subject => $subject, Type =>'multipart/mixed' ) or die "Error creating multipart cont +ainer: $!\n"; # Add the text message part $msg->attach ( Type => 'text/html', Data => qq{ $message_body } ) or die "Error adding the text message part: $!\n"; # Now send $msg->send("sendmail") or die "Error e-mailing: $!\n"; }

The output can be seen here for the image e-mail and the separate info e-mail per the code listed above.

How do I make the jpg name and e-mail subjects display in russian / cyrillic? I have been trying for days.

Best Regards, David


In reply to Problem with russian / cyrillic in e-mail program. by dbmathis

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.