Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/email/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/algorithm/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用phpmailer从php发送utf8 marathi内容邮件_Php_Email_Utf 8 - Fatal编程技术网

使用phpmailer从php发送utf8 marathi内容邮件

使用phpmailer从php发送utf8 marathi内容邮件,php,email,utf-8,Php,Email,Utf 8,我尝试使用phpmailer发送邮件。它对英文内容正常工作,但现在我想发送marathi内容邮件。marathi内容邮件没有发送给用户。邮件看起来像是。 请让我知道我该怎么做。 我的代码是 $mail=new PHPMailer(); $mail->CharSet=“UTF-8”; $mail->IsSMTP();//我们将使用SMTP $mail->SMTPAuth=true;//已启用SMTP身份验证 //$mail->SMTPSecure=“ssl”//用于连接到服务器的安全协议的前缀

我尝试使用phpmailer发送邮件。它对英文内容正常工作,但现在我想发送marathi内容邮件。marathi内容邮件没有发送给用户。邮件看起来像是。 请让我知道我该怎么做。 我的代码是

$mail=new PHPMailer();
$mail->CharSet=“UTF-8”;
$mail->IsSMTP();//我们将使用SMTP
$mail->SMTPAuth=true;//已启用SMTP身份验证
//$mail->SMTPSecure=“ssl”//用于连接到服务器的安全协议的前缀
$mail->Host=”“;//将GMail设置为我们的SMTP服务器
$mail->Port=“”;//连接到GMail的SMTP端口
$mail->Username=“”;//用户电子邮件地址
$mail->Password=“”;//GMail中的密码

$mail->ContentType = "text/html"; //set character set $mail->SetFrom('mail_user1', 'Nathe Publication'); //Who is sending the email $mail->AddReplyTo("mail_user1","Nathe Publication"); //email address that receives the response $mail->Subject = "Email subject"; $mail->Body = '<html><head>'; $mail->Body .= '<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">'; $mail->Body .= '</head><body>'; $mail->Body .= '<p>'; $mail->Body .= "महाराष्ट्र"; $mail->Body .= '</p>'; $mail->Body .= '</body></html>'; $mail->Body = utf8_encode($mail->Body); $mail->Body = utf8_decode($mail->Body); //$mail->AltBody = "Plain text message"; $destino = "mail_user2"; // Who is addressed the email to $mail->AddAddress($destino, "Ashik Lanjewar"); //$mail->AddAttachment("images/phpmailer.gif"); // some attached files //$mail->AddAttachment("images/phpmailer_mini.gif"); // as many as you want if(!$mail->Send()) { $data["message"] = "Error: " . $mail->ErrorInfo; } else { $data["message"] = "Message sent correctly!"; echo $mail->Body; } echo $data["message"]; //$this->load->view('sent_mail',$data); </code>
$mail->ContentType=“text/html”//集合字符集 $mail->SetFrom('mail_user1','Nathe Publication')//谁在发送电子邮件 $mail->AddReplyTo(“mail_user1”,“Nathe Publication”)//接收响应的电子邮件地址 $mail->Subject=“电子邮件主题”; $mail->Body=''; $mail->Body.=''; $mail->Body.=''; $mail->Body.=''; $mail->Body.=”महाराष्ट्र"; $mail->Body.='

'; $mail->Body.=''; $mail->Body=utf8\u编码($mail->Body); $mail->Body=utf8_解码($mail->Body); //$mail->AltBody=“纯文本消息”; $destino=“mail_user2”;//电子邮件的收件人是谁 $mail->AddAddress($destino,“Ashik Lanjewar”); //$mail->AddAttachment(“images/phpmailer.gif”);//一些附加文件 //$mail->AddAttachment(“images/phpmailer_mini.gif”);//您可以随意添加 如果(!$mail->Send()){ $data[“message”]=“Error:”.$mail->ErrorInfo; }否则{ $data[“消息”]=“消息已正确发送!”; echo$mail->Body; } echo$数据[“消息”]; //$this->load->view('sent_mail',$data);