Jump to content

Recommended Posts

I want to send a html mail with multi-language in php.

Some part of mail content is from database. And some part user have to enter.

My database is ok. And Unicode utf-8 is used.

When I am retrieving data from database to my web page is ok. And coming in Russian language,

But when I am using same content to send email, the content comes with Unicode character but not in Russia language

I want mail in Russian,german and turkish language.

 

I am getting html email correctly but with these charecters

output of mail content is ----------------------------------

 

 

ÐÐºÐ°Ð´ÐµÐ¼Ð¸Ñ Ð¤ÐµÐ´ÐµÑ€Ð°Ð»ÑŒÐ½Ð¾Ð³Ð¾ агентÑтва ПравительÑтвенной ÑвÑзи и информации при президенте РоÑÑийÑкой Федерации

 

Ð˜Ð¼Ñ Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ # из # Ð¸Ð¼Ñ Ð²ÑƒÐ·Ð° # приглаÑил Ñ‚ÐµÐ±Ñ Ð²

 

---------------------------------------------------

This is the part of my code , this is written in file name sendmail.php

with

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

 

 

my mail code is as follows-------------

$message = "

<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>

<html xmlns='http://www.w3.org/1999/xhtml'>

<head>

<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />

</head>

<body>

 

<table width='600' border='0' align='left' cellpadding='0' cellspacing='0'>

<tr valign='top'>

<td align='left'><!--header Section Start here-->

<table width='100%' border='0' cellpadding='0' cellspacing='0'>

<tr>

<td height='35' align='left' bgcolor='#3b5998' style='font-size:14px; color:#FFFFFF; font-family:Arial'> $mail1_invitationsent $mail2_invitationsent</td>

</tr>

</table>

<!--header Section end here here-->

</td>

</tr>

<tr>

<td height='20' colspan='2' align='left' bgcolor='#6d84b4' style='font-size:14px; color:#FFFFFF; font-family:Arial; font-style:italic'> $mail3_invitationsent ($college_name)</td>

</tr>

<tr>

<td><table width='600' align='center' cellspacing='0' cellpadding='0' style='BORDER-RIGHT: 1px solid; BORDER-TOP: 1px solid; BORDER-LEFT: 1px solid; border-bottom: 1px solid; border-top-color:#6d84b4; border-right-color:#6d84b4; border-left-color:#6d84b4; border-bottom-color:#6d84b4' >

<tr>

<td><!--Page body Section Start here-->

<table width='600' border='0' align='center' cellpadding='0' cellspacing='0'>

<tr>

<td valign='top'>

<table width='100%' border='0' align='center' cellpadding='0' cellspacing='0'>

<tr>

<td colspan='3'></td>

</tr>

<tr>

<td width='2%'> </td>

<td colspan='2' align='left' style='font-size:12px; font-family:Arial'>$mail_contents</td>

</tr>

<tr>

<td rowspan='5'> </td>

<td height='10' align='left' style='font-size:12px; font-family:Arial'></td>

<td width='37%' rowspan='5' align='left'> </td>

</tr>

<tr>

<td width='61%' height='8' align='left' style='font-size:12px; font-family:Arial'>$mail4_invitationsent </td>

</tr>

<tr>

<td height='10'></td>

</tr>

<tr>

<td height='8' align='left' style='font-size:12px; font-family:Arial'>$mail5_invitationsent </td>

</tr>

<tr>

<td align='left' valign='top' style='font-size:12px; font-family:Arial'></td>

</tr>

<tr>

<td colspan='3'> </td>

</tr>

</table>

</td>

</tr>

</table>

<table width='100%' border='0' cellspacing='0' cellpadding='0'>

<tr>

<td height='3'></td>

</tr>

<tr>

<td></td>

</tr>

</table>

<!--Page body Section end here-->

</td>

</tr>

</table>

<table width='100%' border='0' cellspacing='0' cellpadding='0'>

<tr>

<td>

</td>

</tr>

</table></td>

</tr>

</table>

</body>

</html>

";

// To send HTML mail, the Content-type header must be set

$headers = 'MIME-Version: 1.0' . "\r\n";

$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";

$headers .= 'From: xxxxx' . "\r\n";

mail($to, $subject, $message, $headers);

 

----------------------------- end of code-----------------------

some variables are used to change language

and

$mail_contents is the vatiable of mail contents which is partly from database and partyt from use input.

Plz. solve my prob

 

Link to comment
https://forums.phpfreaks.com/topic/54570-email-problem-in-php/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.