PEAR Forum :: PHP Extension and Application Repository

PEAR Forum Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
send mail in cyrillic or greek language

 
Post new topic   Reply to topic    PEAR Forum Forum Index -> Mail
View previous topic :: View next topic  
Author Message
narcisdragoi



Joined: 13 Jul 2007
Posts: 2

PostPosted: Fri Jul 13, 2007 3:43 pm    Post subject: send mail in cyrillic or greek language Reply with quote

Hello

So i decided to chage the class that helps me to send emails (from phpmailer to pear mail)

I want to send an email in strange language as greek or cyrillic.

<?php
ini_set('include_path','c:\php\PEAR\pear');
require_once 'Mail.php';
include('Mail/mime.php');

// here i include the file that holds the variables $text and $subject;
// this file is saved in utf-8 format with no BOM so the php don't make any output.
include('textes.php');

$crlf = "\n";
$hdrs = array(

'From' => 'myMail@mailbox.domain.com',
'Subject' => $subject

);

$mime = new Mail_mime($crlf);

$mime->setTXTBody($text);
$mime->setHTMLBody('<html><title></title><body>html text ... '.$text.'</body></html>');

$body = $mime->get( array ('head_charset' => 'iso-8859-7', 'head_encoding' => 'quoted-printable', 'text_charset' => 'iso-8859-7', 'html_charset' => 'iso-8859-7')); // greek encoding

$hdrs = $mime->headers($hdrs);

$mail =& Mail::factory('mail');
$mail->send('myMail@mailbox.domain.com', $hdrs, $body);


?>

Here it is may code.

And it doesn't work. The mail is not proprely formated.

Can any one help me please ?
Back to top
View user's profile Send private message
james-gt



Joined: 16 Sep 2007
Posts: 2
Location: Szeged, Hungary

PostPosted: Sun Sep 16, 2007 1:01 pm    Post subject: send mail in utf8 Reply with quote

I had the same problem. A solution, that worked for me:
Code:

$headers = array(
    'From' => $from,
    'Subject' => $subject,
    'Content-Type' => 'text/html; charset="UTF-8"',
);


Isn't it simple? And that hacky-looking Mime class is not needed...

- James
Back to top
View user's profile Send private message
narcisdragoi



Joined: 13 Jul 2007
Posts: 2

PostPosted: Sun Sep 16, 2007 5:47 pm    Post subject: Reply with quote

i solved my problem. Sent the mail with the smtp method. Everything will work great !
Back to top
View user's profile Send private message
james-gt



Joined: 16 Sep 2007
Posts: 2
Location: Szeged, Hungary

PostPosted: Sun Sep 16, 2007 6:14 pm    Post subject: Reply with quote

if this means, that I solved your problem, then I'm happy Wink

if you already made it, then I can only hope that search engines will provide a link for this post for others...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PEAR Forum Forum Index -> Mail All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



PEAR Forum topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group

Provided by Ministry of Web developement

'Actiemonitor' online projectmanagement software