 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
narcisdragoi
Joined: 13 Jul 2007 Posts: 2
|
Posted: Fri Jul 13, 2007 3:43 pm Post subject: send mail in cyrillic or greek language |
|
|
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 |
|
 |
james-gt
Joined: 16 Sep 2007 Posts: 2 Location: Szeged, Hungary
|
Posted: Sun Sep 16, 2007 1:01 pm Post subject: send mail in utf8 |
|
|
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 |
|
 |
narcisdragoi
Joined: 13 Jul 2007 Posts: 2
|
Posted: Sun Sep 16, 2007 5:47 pm Post subject: |
|
|
| i solved my problem. Sent the mail with the smtp method. Everything will work great ! |
|
| Back to top |
|
 |
james-gt
Joined: 16 Sep 2007 Posts: 2 Location: Szeged, Hungary
|
Posted: Sun Sep 16, 2007 6:14 pm Post subject: |
|
|
if this means, that I solved your problem, then I'm happy
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 |
|
 |
|
|
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
|
|