SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jun 2007
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Email problem in php ? Plz. help me!!!!!!

    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 language.
    I am getting right html mail but with some garbage characters instade of original language character.
    This is the part of the mail content
    output of mail content is ----------------------------------


    Академия Федерального агентства Правительственной связи и информации при президенте Российской Федерации

    Имя пользователя # из # имя вуза # пригласил тебя в

    ---------------------------------------------------
    This is the part of code of the page sendmail.php, in which
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    is written to display Multilanguage.
    My page is displaying language correctly.

    my mail code is as follows-------------
    PHP Code:
    <?
    $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
    Last edited by Jelena; Jun 11, 2007 at 00:37.

  2. #2
    SitePoint Enthusiast dannbkk's Avatar
    Join Date
    Jan 2007
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try starting it off with a proper php tag

    PHP Code:
    <?php
    $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>
    Learn SEO - Join the community at GSEO.net
    SEO Book - SEO Revenge eBook
    Make Money Programs - No Fluff!
    Make Money Online

  3. #3
    SitePoint Member
    Join Date
    Jun 2007
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    re:

    Quote Originally Posted by dannbkk View Post
    Try starting it off with a proper php tag

    PHP Code:
    <?php
    $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>

    Hi,

    What I have given the part of code.
    Yes there is a php tag what you have mentioned.
    I am getting email correcty
    But with unicode charecter
    not with actual language.
    help me?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •