- This topic has 8 replies, 2 voices, and was last updated 5 years, 5 months ago by
Support. This post has been viewed 1327 times
-
AuthorPosts
-
February 1, 2021 at 3:50 am #10035901
beyond_the_dream
ParticipantI followed all the steps on instruction but it’s not working.
Also, If I use other languages, the alert says ‘please fill the form.’ I’m using a different language which is Korean. How can I say language setting for a contact form?
Please help me!!
(If I attached the code, then my ticket is just blocked by a security issue.)
February 1, 2021 at 3:52 am #10035902beyond_the_dream
Participant<?php /* Name: Contact Form Written by: Okler Themes - (http://www.okler.net) Theme Version: 8.3.0 */ namespace PortoContactForm; session_cache_limiter('nocache'); header('Expires: ' . gmdate('r', 0)); header('Content-type: application/json'); use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; require 'php-mailer/src/PHPMailer.php'; require 'php-mailer/src/SMTP.php'; require 'php-mailer/src/Exception.php'; // Step 1 - Enter your email address below. $email = '[email protected]'; // If the e-mail is not working, change the debug option to 2 | $debug = 2; $debug = 2; // If contact form don't has the subject input change the value of subject here $subject = ( isset($_POST['subject']) ) ? $_POST['subject'] : 'Define subject in php/contact-form.php line 29'; $message = ''; foreach($_POST as $label => $value) { $label = ucwords($label); // Use the commented code below to change label texts. On this example will change "Email" to "Email Address" // if( $label == 'Email' ) { // $label = 'Email Address'; // } // Checkboxes if( is_array($value) ) { // Store new value $value = implode(', ', $value); } $message .= $label.": " . htmlspecialchars($value, ENT_QUOTES) . "<br>\n"; } $mail = new PHPMailer(true); try { $mail->SMTPDebug = $debug; // Debug Mode // Step 2 (Optional) - If you don't receive the email, try to configure the parameters below: //$mail->IsSMTP(); // Set mailer to use SMTP //$mail->Host = 'mail.yourserver.com'; // Specify main and backup server //$mail->SMTPAuth = true; // Enable SMTP authentication //$mail->Username = '[email protected]'; // SMTP username //$mail->Password = 'secret'; // SMTP password //$mail->SMTPSecure = 'tls'; // Enable encryption, 'ssl' also accepted //$mail->Port = 587; // TCP port to connect to $mail->AddAddress($email); // Add another recipient //$mail->AddAddress('[email protected]', 'Person 2'); // Add a secondary recipient //$mail->AddCC('[email protected]', 'Person 3'); // Add a "Cc" address. //$mail->AddBCC('[email protected]', 'Person 4'); // Add a "Bcc" address. // From - Name $fromName = ( isset($_POST['name']) ) ? $_POST['name'] : 'Website User'; $mail->SetFrom($email, $fromName); // Repply To if( isset($_POST['email']) ) { $mail->AddReplyTo($_POST['email'], $fromName); } $mail->IsHTML(true); // Set email format to HTML $mail->CharSet = 'UTF-8'; $mail->Subject = $subject; $mail->Body = $message; $mail->Send(); $arrResult = array ('response'=>'success'); } catch (Exception $e) { $arrResult = array ('response'=>'error','errorMessage'=>$e->errorMessage()); } catch (\Exception $e) { $arrResult = array ('response'=>'error','errorMessage'=>$e->getMessage()); } if ($debug == 0) { echo json_encode($arrResult); }
February 2, 2021 at 12:26 am #10035918Support
KeymasterHello,
1) To translate the validation plugin add the code below at (js/views/view.contact.js):
$.extend( $.validator.messages, { required: "필수 항목입니다.", remote: "항목을 수정하세요.", email: "유효하지 않은 E-Mail주소입니다.", url: "유효하지 않은 URL입니다.", date: "올바른 날짜를 입력하세요.", dateISO: "올바른 날짜(ISO)를 입력하세요.", number: "유효한 숫자가 아닙니다.", digits: "숫자만 입력 가능합니다.", creditcard: "신용카드 번호가 바르지 않습니다.", equalTo: "같은 값을 다시 입력하세요.", extension: "올바른 확장자가 아닙니다.", maxlength: $.validator.format( "{0}자를 넘을 수 없습니다. " ), minlength: $.validator.format( "{0}자 이상 입력하세요." ), rangelength: $.validator.format( "문자 길이가 {0} 에서 {1} 사이의 값을 입력하세요." ), range: $.validator.format( "{0} 에서 {1} 사이의 값을 입력하세요." ), max: $.validator.format( "{0} 이하의 값을 입력하세요." ), min: $.validator.format( "{0} 이상의 값을 입력하세요." ) } );* Add in the top position of script.
Also change the attributes at HTML source code to korean sentences like the image below:

2) Regarding not receiving the emails, probably your server do not allow send emails to a domain different from your website (gmail.com on this case). My suggestion is enable the SMTP settings to send the emails. For it you should uncomment the “Step 2” of contact-form.php file:

* Get the correct infos like Host, SMTPAuth, Port, etc.. with your server hosting support.
Please try that and let us know if you need further assistance.
Kind Regards,
Rodrigo.
If you are satisfied with Porto HTML and our support, please leave your comment and rating on ThemeForest downloads page. That helps us a lot: https://themeforest.net/downloads
February 3, 2021 at 3:05 am #10035945beyond_the_dream
ParticipantThank you so much!!!!!!!!
I changed the email address to my server’s, then it’s working now!!!
You saved me haha
but I’m still trying to fix the language issue in a submit form….. Please help me…
I attached [1) To translate the validation plugin add the code below at (js/views/view.contact.js):] this code very top of the page.(above the function), Also changed the HTML source code to korean sentences like the image you gave me.
I still can’t understand why it’s still not working
I also changed the
<html lang="ko">lan to Korean from all my html files.https://www.smart-factory.ai/ZEZO_about_us.html
this is the link of my website.
thank you!
February 3, 2021 at 6:23 am #10035949Support
KeymasterHello,
Great the issue with email is resolved 🙂
Regarding translation, inspecting your website we still can see english sentences:

Change to Korean and the issue should be resolved.
Please try that and let us know if you need further assistance.
Kind Regards,
Rodrigo.
If you are satisfied with Porto HTML and our support, please leave your comment and rating on ThemeForest downloads page. That helps us a lot: https://themeforest.net/downloads
February 3, 2021 at 5:20 pm #10035952beyond_the_dream
ParticipantHi 🙂
Thank you for your support!
I updated all language information by Korean but it’s still not working.
Is there any way I can change the input language setting?
// No White Space $.validator.addMethod("noSpace", function(value, element) { if( $(element).attr('required') ) { return value.search(/[a-zA-Z0-9À-žа-яА-ЯёЁα-ωΑ-Ω\s\u0621-\u064A\u0660-\u0669 ]/i) == 0; } return true; }, '올바른 정보를 입력해주세요.');This is the original code for checking white space, but it only can read English for inputs.
so can I add Korean Unicode in there? like
/[\uac00-\ud7af]|[\u1100-\u11ff]|[\u3130-\u318f]|[\ua960-\ua97f]|[\ud7b0-\ud7ff]/g)I don’t know how can I combine them.
Thank you again!
Hope you have a great day ^_^
February 3, 2021 at 11:46 pm #10035960Support
KeymasterHello,
I entered your website now and the validation messages are in Korean when I try to send the form with empty fields:

Regarding the white space code, you are right. You should change the regex for Korean characters too. Change to:
return value.search(/[a-zA-Z0-9À-žа-яА-ЯёЁα-ωΑ-Ω\s\u0621-\u064A\u0660-\u0669 [\uac00-\ud7af]|[\u1100-\u11ff]|[\u3130-\u318f]|[\ua960-\ua97f]|[\ud7b0-\ud7ff]]/i) == 0;
We hope this helps!
Hope you have a great day too!
Kind Regards,
Rodrigo.
If you are satisfied with Porto HTML and our support, please leave your comment and rating on ThemeForest downloads page. That helps us a lot: https://themeforest.net/downloads
February 4, 2021 at 1:43 am #10035970beyond_the_dream
ParticipantThis reply has been marked as private.February 4, 2021 at 6:28 am #10035975Support
KeymasterThis reply has been marked as private. -
AuthorPosts
This topic is marked as "RESOLVED" and can not rceive new replies.