Greetings all,

I have to send emails through a smtp server, with Chinese  character
encoding.


In details , the  encoding of my  send mail is UTF-8, but the encoding of

others received is GB2321 , so it will apprears with "weird" characters.


Does anyone has any working example or any suggestion please ?

Best Regards,


My code is :

   1. #!/usr/bin/perl
   2.
   3.
   4. use strict;
   5. use Mail::Sendmail;
   6. use MIME::Base64;
   7.
   8. my $content = `cat tmp.txt`;
   9.
   10. print "Sending an email .....";
   11.
   12. my %mail = (
   13.                       To            => "x...@xx.com",
   14.                       From         =>  "x...@xx.com",
   15.                        Subject       => "test",
   16.                        content-type   => "text/plain",
   17.                        content-transfer-encoding     => 'base64',
   18.                         Message     => $content,
   19.                           smtp       => "xx.xx.xx",
   20. );
   21.
   22.
   23. if  (sendmail %mail) { print "Mail send ok!\n";}
   24.
   25. else {print "Error : $mail::Sendmail::errror\n"}


The "tmp.txt" is the content of Chinese .

Reply via email to