[vhffs-dev] [1020] Fixed charset/encoding in mails sent by VHFFS

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 1020
Author:   gradator
Date:     2007-10-24 11:57:15 +0000 (Wed, 24 Oct 2007)

Log Message:
-----------
Fixed charset/encoding in mails sent by VHFFS

Modified Paths:
--------------
    trunk/vhffs-api/src/Vhffs/Functions.pm
    trunk/vhffs-robots/src/mailing.pl


Modified: trunk/vhffs-api/src/Vhffs/Functions.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Functions.pm	2007-10-22 23:23:34 UTC (rev 1019)
+++ trunk/vhffs-api/src/Vhffs/Functions.pm	2007-10-24 11:57:15 UTC (rev 1020)
@@ -257,6 +257,7 @@
 sub send_mail
 {
 	use MIME::Lite;
+	use MIME::Base64;
 
 	my $from = shift;
 	my $to = shift;
@@ -265,12 +266,14 @@
 	my $message = shift;
 
 	$subject = $mailtag.' '.$subject if( defined $mailtag );
+	$subject = '=?UTF-8?B?'.encode_base64( $subject , '' ).'?=';
 
 	my $msg = new MIME::Lite
-		From    => "$from",
-		To      => "$to",
-		Subject => "$subject",
+		From    => $from,
+		To      => $to,
+		Subject => $subject,
 		Type    => 'text/plain; charset=utf-8',
+		Encoding => '8bit',
 		Data    => "$message";
 	$msg->send;
 

Modified: trunk/vhffs-robots/src/mailing.pl
===================================================================
--- trunk/vhffs-robots/src/mailing.pl	2007-10-22 23:23:34 UTC (rev 1019)
+++ trunk/vhffs-robots/src/mailing.pl	2007-10-24 11:57:15 UTC (rev 1020)
@@ -74,8 +74,7 @@
 	foreach my $user ( @{$users} )
 	{
 		next unless defined $user;
-#		Vhffs::Functions::send_mail( $from , $user->get_mail , $vhffs->get_config->get_mailtag , '=?utf-8?'.$subject.'?=' , $message );
-		Vhffs::Functions::send_mail( $from , $user->get_mail , $vhffs->get_config->get_mailtag , '=?iso-8859-1?Q?V=E9rificatio?=' , $message );
+		Vhffs::Functions::send_mail( $from , $user->get_mail , $vhffs->get_config->get_mailtag , $subject , $message );
 	}
 
 	my $query = "UPDATE vhffs_mailings SET state='".Vhffs::Constants::ACTIVATED."' WHERE id_mailing='".$idm."'";


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/