We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,613 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

my email form dont supports unicode fonts !! help

hi, my email form is written in php, it does not support multiple languages i mean unicode fonts. it shows something like this: খোলা জানালা . In this case what i should do.

2
Contributors
6
Replies
1 Day
Discussion Span
11 Months Ago
Last Updated
8
Views
rakibtg
Junior Poster in Training
74 posts since Oct 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Show your code. Email should support unicode. Depends how the data is being sent too.

diafol
Keep Smiling
Moderator
10,625 posts since Oct 2006
Reputation Points: 1,628
Solved Threads: 1,506
Skill Endorsements: 57

ok
contact.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Contact</title>
<style type="text/css">
<!--
.style2 {font-family: Arial, Helvetica, sans-serif; font-size: 14px;}
.style3 {
    font-size: 10px;
    font-family: Verdana, Arial, Helvetica, sans-serif;
}
.style6 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8px; }
.style7 {color: #FF0000}
-->
</style>
</head>
<body>
<table width="100%" border="0">
  <tr>
    <td width="63%"><form action="pub-process.php" method="post" class="style2">

<?php
$ipi = getenv("REMOTE_ADDR");
$httprefi = getenv ("HTTP_REFERER");
$httpagenti = getenv ("HTTP_USER_AGENT");
?>
<input type="hidden" name="ip" value="<?php echo $ipi ?>" />
<input type="hidden" name="httpref" value="<?php echo $httprefi ?>" />
<input type="hidden" name="httpagent" value="<?php echo $httpagenti ?>" />
<form><input type="text" name="name" value="Your Name" size="60" maxlength="45"/><br /><input type="text" name="emailaddress" value="Email Address" size="60" maxlength="45"/><br /><input type="text" name="subject" value="Subject" size="60" maxlength="45"/><br /><input type="text" name="description" value="Description" size="60" maxlength="45"/><br />
<input type="submit" value="E-mail It" />
<br />
</form></td>
  </tr>
</table>
</body>

send.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Thanks</title>
</head>
<body>
<?php
$name = $_POST['name'];
$emailaddress = $_POST['emailaddress'];
$subject = $_POST['subject'];
$description = $_POST['description'];
if (eregi('fun', $name)) {
die ("Dont do");
}
$todayis = date("l, F j, Y, g:i a") ;
$subject = $name;
$message = "<h1>Name: $name<br />Email Address: $emailaddress<br />Subject: $subject<br />Description: $description<br />";
    $from = "MIME-Version: 1.0" . "\r\n";
    $from .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
    $from .= "From: $emailaddress" . "\r\n";
mail("email@gmail.com", $subject, $message, $from);
?>
Thank You
</body>
</html>
rakibtg
Junior Poster in Training
74 posts since Oct 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

so can you tell me where to change or a sample
thankyou

rakibtg
Junior Poster in Training
74 posts since Oct 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Try this for now:

<?php
header('Content-Type: text/html; charset=utf-8');
$name = $_POST['name'];
$emailaddress = $_POST['emailaddress'];
$subject = $_POST['subject'];
$description = $_POST['description'];
if (eregi('fun', $name)) {
die ("Dont do"); //change this to a header
}
$todayis = date("l, F j, Y, g:i a") ;
$subject = $name;
$message = "<h1>Name: $name</h1><p>Email Address: $emailaddress</p><p>Subject: $subject</p>Description: $description";
    $from = "MIME-Version: 1.0" . "\r\n";
    $from .= "Content-type:text/html;charset=UTF-8" . "\r\n";
    $from .= "From: $emailaddress" . "\r\n";
    mail("email@gmail.com", $subject, $message, $from);
?>
Thank You
diafol
Keep Smiling
Moderator
10,625 posts since Oct 2006
Reputation Points: 1,628
Solved Threads: 1,506
Skill Endorsements: 57

well, thanks for your post but still it's not working !!!

rakibtg
Junior Poster in Training
74 posts since Oct 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

See if it's the data being sent by the form as opposed to the dat being sent via mail:

<?php
header('Content-Type: text/html; charset=utf-8');
$name = $_POST['name'];
$emailaddress = $_POST['emailaddress'];
$subject = $_POST['subject'];
$description = $_POST['description'];

//THIS SHOULD SHOW what you typed - if not - this is the issue
echo $description;
exit;
//STOP CODE on exit

if (eregi('fun', $name)) {
die ("Dont do"); //change this to a header
}
$todayis = date("l, F j, Y, g:i a") ;
$subject = $name;
$message = "<h1>Name: $name</h1><p>Email Address: $emailaddress</p><p>Subject: $subject</p>Description: $description";
    $from = "MIME-Version: 1.0" . "\r\n";
    $from .= "Content-type:text/html;charset=UTF-8" . "\r\n";
    $from .= "From: $emailaddress" . "\r\n";
    mail("email@gmail.com", $subject, $message, $from);
?>
diafol
Keep Smiling
Moderator
10,625 posts since Oct 2006
Reputation Points: 1,628
Solved Threads: 1,506
Skill Endorsements: 57

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0759 seconds using 2.74MB