zack1475 Posted March 28, 2011 Share Posted March 28, 2011 Ok first i will do my best not to make too much mistakes, my english is far then perfect... I have a problem like alot of people wiht the email accent encoding. First every single files in my website is in utf-8 ( dreamweaver -propreties-encode-utf- My Mysql is in utf-8 and still when people send email the user received with @ instead of é ect... Here is the code of the @mail function in question : <?php session_start ( ) ; require ( "config.php" ) ; if ( intval ( $_POST["AdID"] ) > 0 ) { if ( $_SESSION["capCode"] == $_POST["BBUV"] ) { require_once ( "classes/manipulate.php" ) ; $data = new DataManipulator ; $siteSettings = $data->select ( "SiteManager" , "*" , null , 0 , 50 ) ; $app_init_data = array ( ) ; foreach ( $siteSettings as $site ) { $app_init_data[$site["SiteVariable"]] = $site["SiteValue"] ; } $classified = $data->select ( "Classified" ,"*" , array ( "AdID" => intval ( $_POST["AdID"] ) ) ) ; $classified = $classified[0] ; $data->update ( "Classified" , " Replies=Replies+1" , array ( "AdID" => intval ( $_POST["AdID"] ) ) ) ; @mail ( $classified["EmailAddress"] , "Votre annonce sur ".base_url , "Bonjour, \n vous avez un message pour votre annonce '".$classified["AdTitle"]."' par un visiteur avec l'adresse courriel '".$_POST["FromEmailAddress"]."' : \n ".$_POST["EmailText"]." \n\n --------------------- \n ".$app_init_data["SiteName"]." <strong><strong>Svp repondre a l'adresse courriel du membre et non a celui-ci. Merci de votre confiance</strong></strong>, \n". base_url , "from:".$app_init_data["SiteTitle"]."<".$app_init_data["Replyemail"].">" ) ; $_SESSION["str_system_message"] = "Votre message a été envoyé." ; } else $_SESSION["str_system_message"] = "Code de sécurité invalide." ; } header ( "location:".$_SERVER['HTTP_REFERER'] ) ; ?> This part : $_SESSION["str_system_message"] = "Votre message a été envoyé." ; show the accent correcly because my page is encoded in utf-8 The problem is there : @mail ( $classified["EmailAddress"] , "Votre annonce sur ".base_url , "Bonjour, \n vous avez un message pour votre annonce '".$classified["AdTitle"]."' par un visiteur avec l'adresse courriel '".$_POST["FromEmailAddress"]."' : \n ".$_POST["EmailText"]." \n\n --------------------- \n ".$app_init_data["SiteName"]." <strong><strong>Svp repondre a l'adresse courriel du membre et non a celui-ci. Merci de votre confiance</strong></strong>, \n". base_url , "from:".$app_init_data["SiteTitle"]."<".$app_init_data["Replyemail"].">" ) ; if i use accent in this part of the code it show incorrectly. Its the first time i post on this forum, so if i forget something , please let me know. Zack1475 Quote Link to comment https://forums.phpfreaks.com/topic/231983-help-needed/ Share on other sites More sharing options...
Maq Posted March 28, 2011 Share Posted March 28, 2011 In the future, please use tags around your code. Quote Link to comment https://forums.phpfreaks.com/topic/231983-help-needed/#findComment-1193405 Share on other sites More sharing options...
zack1475 Posted March 28, 2011 Author Share Posted March 28, 2011 Got it ! sorry about that Quote Link to comment https://forums.phpfreaks.com/topic/231983-help-needed/#findComment-1193406 Share on other sites More sharing options...
PFMaBiSmAd Posted March 28, 2011 Share Posted March 28, 2011 You would need to send the email as a HTML email with the proper character set selected in the mail header field. See example #4 at this link - http://us3.php.net/manual/en/function.mail.php I also recommend that you form the subject, message, and header fields in php variables and then simply put those variables into the mail() function call. It will make writing and reading your code a lot easier and clearer. Quote Link to comment https://forums.phpfreaks.com/topic/231983-help-needed/#findComment-1193407 Share on other sites More sharing options...
zack1475 Posted March 28, 2011 Author Share Posted March 28, 2011 You would need to send the email as a HTML email with the proper character set selected in the mail header field. See example #4 at this link - http://us3.php.net/manual/en/function.mail.php I also recommend that you form the subject, message, and header fields in php variables and then simply put those variables into the mail() function call. It will make writing and reading your code a lot easier and clearer. Ok the part i do not understand , is that it is not a fix email adresse who will received the anwser, the actual code is a code to reply to an ad. If i use the example # 4 i need to specify an email adresse wich i do not have. for an exemple see this url : http://adsfast.ca/~Miniature-Dachshunds~-Ready-april-6th~/ and see the '' contact poster by e-mail '' The code i need to modify is excactly like this one but for my french version ! Quote Link to comment https://forums.phpfreaks.com/topic/231983-help-needed/#findComment-1193409 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.