I encoded the Korean mail form as base64, but I would like to receive the confirmation mail in the language I entered (Korean).

Asked 2 years ago, Updated 2 years ago, 63 views

Instead of a full scratch, we originally modified the Japanese email form to create a Korean email form.

$MAIL_SUBJECT='Automatic Mail Title';
$MAILTO=$in[email];
$FH = fopen('Email to send model .mail', "r");
$MAIL_MESS=fread($FH,1000000);
fclose ($FH);
// ----- contents of the email
$MAIL_MESS = str_replace("[st_date]", $in[st_date], $MAIL_MESS);
// ----- encoding specification
mb_language("uni");
$MAIL=base64_encode($MAIL_MESS);

// $MAIL_SUBJECT=JcodeConvert($MAIL_SUBJECT,0,3);
$sender_name = 'Sender name displayed in mailer';
$Header="From:".mb_encode_mimeheader($sender_name)."<{$ADMIN_MAIL}>\nCC:{$ADMIN_MAIL}\n";
if(!mb_send_mail($MAILTO,$MAIL_SUBJECT,$MAIL,$Header)){
    $val = "Not send mail";
    setcookie("inb_err_msg[email]", "$val", 0, "/");
    header("Location:form.html");
    exit();
}

By encoding base64, I can receive mail without garbled characters.
The text (of course) is base64 encoded.
I would like to receive it in the language I entered (Korean), but what kind of description do I need?

php mail

2022-09-30 11:43

1 Answers

in the email header
Content-Transfer-Encoding—base64

and .This will allow the mailer to decode base64 and display it on the screen.
Note: How Japanese Mail Works|SendGrid Blog

mb_send_mail() specifies the mail header as the fourth argument (additional_headers), but
You may not need to specify base64_encode or Content-Transfer-Encoding yourself because it says mb_language("uni").

You may find out if you could provide a wider range of program codes, the PHP version, and the header part of the email you actually received with this code.


2022-09-30 11:43

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.