Mam problem z pewną funkcją (ponizej)
Mianowicie chodzi mi o wysyłanie maila, gdy go wyśle zamiast polskich liter (ąęł etc.) wyskakują same krzaki.
Próbowałem dorzucić w pewnych miejscach linijke:
/nMIME-Version: 1.0nContent-type: text/html; charset=UTF-8
ale to nie zadziałało.. Prosiłbym o pomoc
function processadcontact($adid,$sendersname,$checkhuman,$numval1,$numval2,$sendersemail,$contactmessage,$ermsg)
{
global $nameofsite,$siteurl,$thisadminemail; $error=false;
$adidmsg='';
$sendersnamemsg='';
$checkhumanmsg='';
$sendersemailmsg='';
$contactmessagemsg='';
$sumwrongmsg='';
$sendersemailwrongmsg='';
$thesum=($numval1 + $numval2);
{
$error=true;
$adidmsg="<li>";
$adidmsg.=__("The ad could not be identified due to a missing ad identification number","AWPCP");
$adidmsg.="</li>";
}
{
$error=true;
$sendersnamemsg="<li>";
$sendersnamemsg.=__("You did not enter your name. You must include a name for this message to be relayed on your behalf","AWPCP");
$sendersnamemsg.="</li>";
}
if(get_awpcp_option('contactformcheckhuman') == 1)
{
{
$error=true;
$checkhumanmsg="<li>";
$checkhumanmsg.=__("You did not solve the Math Problem","AWPCP");
$checkhumanmsg.="</li>";
}
if($checkhuman != $thesum)
{
$error=true;
$sumwrongmsg="<li>";
$sumwrongmsg.=__("Your solution to the Math problem was incorrect","AWPCP");
$sumwrongmsg.="</li>";
}
}
if(!isset($contactmessage) || empty($contactmessage)) {
$error=true;
$contactmessagemsg="<li>";
$contactmessagemsg.=__("There was no text entered for your message","AWPCP");
$contactmessagemsg.="</li>";
}
{
$error=true;
$sendersemailmsg="<li>";
$sendersemailmsg.=__("You did not enter your name. You must include a name for this message to be relayed on your behalf","AWPCP");
$sendersemailmsg.="</li>";
}
if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $sendersemail)) {
$error=true;
$sendersemailwrongmsg="<li>";
$sendersemailwrongmsg.=__("The email address you entered was not a valid email address. Please check for errors and try again","AWPCP");
$sendersemailwrongmsg.="</li>";
}
if($error)
{
$ermsg="<p>";
$ermsg.=__("There has been an error found. Your message has not been sent. Please review the list of problems, correct them then try to send your message again","AWPCP");
$ermsg.="</p>";
$ermsg.="<b>";
$ermsg.=__("The errors","AWPCP");
$ermsg.=":</b><br/>";
$ermsg.="<ul>$adidmsg $sendersnamemsg $checkhumanmsg $contactmessagemsg $sumwrongmsg $sendersemailmsg $sendersemailwrongmsg</ul>";
load_ad_contact_form($adid,$sendersname,$checkhuman,$numval1,$numval2,$sendersemail,$contactmessage,$ermsg);
}
else
{
$sendersname=strip_html_tags($sendersname);
$contactmessage=strip_html_tags($contactmessage);
$theadtitle=get_adtitle($adid);
$sendtoemail=get_adposteremail($adid);
$contactformsubjectline=get_awpcp_option('contactformsubjectline');
if(isset($contactformsubjectline) && !empty($contactformsubjectline) ) {
$subject="$contactformsubjectline";
}
else
{
$subject=__("Regarding","AWPCP");
$subject.=": $theadtitle";
}
$awpcpbreak1="<br/>";
$awpcpbreak2="<br/><br/>";
$contactformbodymessage=get_awpcp_option('contactformbodymessage');
$contactformbodymessage.="$awpcpbreak2";
$contactformbodymessage.=__("Message","AWPCP");
$contactformbodymessage.="$awpcpbreak2";
$contactformbodymessage.=$contactmessage;
$contactformbodymessage.="$awpcpbreak2";
$contactformbodymessage.=__("Reply To","AWPCP");
$contactformbodymessage.=$sendersemail;
$contactformbodymessage.="$awpcpbreak2";
$contactformbodymessage.="$nameofsite";
$contactformbodymessage.="$awpcpbreak1";
$contactformbodymessage.=$siteurl;
$contactformbodymessage.="$awpcpbreak1";
$from_header = "From: ". $nameofsite . " <" . $thisadminemail . ">\r\n";
if(send_email($thisadminemail,$sendtoemail,$subject,$contactformbodymessage,true))
{
$contactemailmailsent=1;
}
else
{
$contactformbodymessage=str_replace("$awpcpbreak1", "\n", $contactformbodymessage); $contactformbodymessage=str_replace("$awpcpbreak2", "\n\n", $contactformbodymessage);
if((mail($sendtoemail, $subject, $contactformbodymessage, $from_header))) {
$contactemailmailsent=1;
}
else
{
$awpcp_smtp_host = get_awpcp_option('smtphost');
$awpcp_smtp_username = get_awpcp_option('smtpusername');
$awpcp_smtp_password = get_awpcp_option('smtppassword');
$contactformbodymessage=str_replace("$awpcpbreak1", "\n", $contactformbodymessage); $contactformbodymessage=str_replace("$awpcpbreak2", "\n\n", $contactformbodymessage);
$headers = array ('From' => $from_header, 'To' => $sendtoemail,
'Subject' => $subject);
$smtp = Mail::factory('smtp', array ('host' => $awpcp_smtp_host, 'auth' => true,
'username' => $awpcp_smtp_username,
'password' => $awpcp_smtp_password));
$mail = $smtp->send($sendtoemail, $headers, $contactformbodymessagx);
if (PEAR::isError($mail))
{
$contactemailmailsent=0;
}
else
{
$contactemailmailsent=1;
}
}
}
if($contactemailmailsent)
{
$contactformprocessresponse=__("Your message has been sent","AWPCP");
}
else
{
$contactformprocessresponse=__("There was a problem encountered during the attempt to send your message. Please try again and if the problem persists, please contact the system administrator","AWPCP");
}
}
$contactpostform_content=$contactformprocessresponse;
echo "<div id=\"classiwrapper\">"; awpcp_menu_items();
echo $contactformprocessresponse;
}