Jump to content

Recommended Posts

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-8)

 

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

Link to comment
https://forums.phpfreaks.com/topic/231983-help-needed/
Share on other sites

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.

 

Link to comment
https://forums.phpfreaks.com/topic/231983-help-needed/#findComment-1193407
Share on other sites

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 !

Link to comment
https://forums.phpfreaks.com/topic/231983-help-needed/#findComment-1193409
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.