Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I have trouble sending Greek mail using UTF-8 encoding. I tried several solutions with different levels of success, but I always had problems. The latest try was the Swift mailer, here's some relative code:Code: Select all
function xmail2($email_address, $email_from, $subject, $msg, $attach_filepath, $email_address_cc="")
{
$list_to = explode( ',', $email_address );
$list_cc = explode( ',', $email_address_cc );
$mailer =& new Swift( new Swift_Connection_NativeMail() );
$message =& new Swift_Message( $subject, '', "text/plain", "8bit", "utf-8" );
$recipients =& new Swift_RecipientList();
foreach ( $list_to as $to )
{
$to = trim( $to );
if ( $to ) $recipients->addTo( $to );
}
foreach ( $list_cc as $to )
{
$to = trim( $to );
if ( $to ) $recipients->addCC( $to );
}
$from =& new Swift_Address( "mymail@me.gr", "My name" );
$part = new Swift_Message_Part( $msg, "text/plain", "8bit", "utf-8" );
$message->attach( $part );
foreach ( $attach_filepath as $attachment )
{
$message->attach( new Swift_Message_Attachment( new Swift_File( $attachment ) ) );
}
return $mailer->send( $message, $recipients, $from );
}Weirdan | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]