From 58392f82c932a934a3d302cf05d90c037a48de5c Mon Sep 17 00:00:00 2001 From: "jisangs (iMac)" Date: Tue, 18 Jun 2024 14:28:29 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9D=B4=EB=A9=94=EC=9D=BC=20=EB=B0=9C?= =?UTF-8?q?=EC=86=A1=20SMTP=20=EB=B3=80=EA=B2=BD:=20naver=20->=20gmail(jin?= =?UTF-8?q?aju.com)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * jinaju.com SPF 설정 작업이 선행됨 --- .../batch/send_mail_to_7days_left_maestro.php | 2 +- .../send_mail_to_closed_beta_paid_maestro.php | 2 +- .../batch/send_mail_to_overdated_maestro.php | 2 +- .../test_send_mail_to_7days_left_maestro.php | 2 +- ..._send_mail_to_closed_beta_paid_maestro.php | 2 +- .../test_send_mail_to_overdated_maestro.php | 2 +- src/web/server/admin/extension_maestro.php | 2 +- src/web/server/admin/register_maestro.php | 2 +- src/web/server/admin/upgrade_maestro.php | 2 +- src/web/server/maestro/add_maestro.php | 2 +- .../maestro/request_extension_maestro.php | 2 +- .../maestro/request_upgrade_maestro.php | 2 +- .../server/maestro/update_maestro_info.php | 2 +- src/web/server/mail/send_jinaju_mail.php | 276 ++++++++++++++++++ src/web/server/mail/send_mail_test.php | 2 +- 15 files changed, 290 insertions(+), 14 deletions(-) create mode 100644 src/web/server/mail/send_jinaju_mail.php diff --git a/src/php-cli/batch/send_mail_to_7days_left_maestro.php b/src/php-cli/batch/send_mail_to_7days_left_maestro.php index a337732..c95e0a7 100644 --- a/src/php-cli/batch/send_mail_to_7days_left_maestro.php +++ b/src/php-cli/batch/send_mail_to_7days_left_maestro.php @@ -8,7 +8,7 @@ include __DIR__."/../../web/server/setup/connect_db.php"; include __DIR__."/../../web/php/mail/mail_setting.php"; include __DIR__."/../../web/server/mail/mail_contents.php"; include __DIR__."/../../web/server/lib/maestro_account_info.php"; -include __DIR__."/../../web/server/mail/send_naver_mail.php"; +include __DIR__."/../../web/server/mail/send_jinaju_mail.php"; $maestroList = null; $maestroList = get_closed_beta_paid_maestro_list(); diff --git a/src/php-cli/batch/send_mail_to_closed_beta_paid_maestro.php b/src/php-cli/batch/send_mail_to_closed_beta_paid_maestro.php index c10e785..6ad0bfb 100644 --- a/src/php-cli/batch/send_mail_to_closed_beta_paid_maestro.php +++ b/src/php-cli/batch/send_mail_to_closed_beta_paid_maestro.php @@ -8,7 +8,7 @@ include __DIR__."/../../web/server/setup/connect_db.php"; include __DIR__."/../../web/php/mail/mail_setting.php"; include __DIR__."/../../web/server/mail/mail_contents.php"; include __DIR__."/../../web/server/lib/maestro_account_info.php"; -include __DIR__."/../../web/server/mail/send_naver_mail.php"; +include __DIR__."/../../web/server/mail/send_jinaju_mail.php"; add_1_month_closed_beta_paid_maestro(); diff --git a/src/php-cli/batch/send_mail_to_overdated_maestro.php b/src/php-cli/batch/send_mail_to_overdated_maestro.php index 67e2548..b2076e6 100644 --- a/src/php-cli/batch/send_mail_to_overdated_maestro.php +++ b/src/php-cli/batch/send_mail_to_overdated_maestro.php @@ -8,7 +8,7 @@ include __DIR__."/../../web/server/setup/connect_db.php"; include __DIR__."/../../web/php/mail/mail_setting.php"; include __DIR__."/../../web/server/mail/mail_contents.php"; include __DIR__."/../../web/server/lib/maestro_account_info.php"; -include __DIR__."/../../web/server/mail/send_naver_mail.php"; +include __DIR__."/../../web/server/mail/send_jinaju_mail.php"; $maestroList = null; $maestroList = get_overdated_maestro_list(); diff --git a/src/php-cli/batch/test_send_mail_to_7days_left_maestro.php b/src/php-cli/batch/test_send_mail_to_7days_left_maestro.php index 855820a..154fe11 100644 --- a/src/php-cli/batch/test_send_mail_to_7days_left_maestro.php +++ b/src/php-cli/batch/test_send_mail_to_7days_left_maestro.php @@ -8,7 +8,7 @@ include __DIR__."/../../web/server/setup/connect_db.php"; include __DIR__."/../../web/php/mail/mail_setting.php"; include __DIR__."/../../web/server/mail/mail_contents.php"; include __DIR__."/../../web/server/lib/maestro_account_info.php"; -include __DIR__."/../../web/server/mail/send_naver_mail.php"; +include __DIR__."/../../web/server/mail/send_jinaju_mail.php"; $maestroList = null; $maestroList = get_closed_beta_paid_maestro_list(); diff --git a/src/php-cli/batch/test_send_mail_to_closed_beta_paid_maestro.php b/src/php-cli/batch/test_send_mail_to_closed_beta_paid_maestro.php index fa54cad..2082c3f 100644 --- a/src/php-cli/batch/test_send_mail_to_closed_beta_paid_maestro.php +++ b/src/php-cli/batch/test_send_mail_to_closed_beta_paid_maestro.php @@ -8,7 +8,7 @@ include __DIR__."/../../web/server/setup/connect_db.php"; include __DIR__."/../../web/php/mail/mail_setting.php"; include __DIR__."/../../web/server/mail/mail_contents.php"; include __DIR__."/../../web/server/lib/maestro_account_info.php"; -include __DIR__."/../../web/server/mail/send_naver_mail.php"; +include __DIR__."/../../web/server/mail/send_jinaju_mail.php"; //add_1_month_closed_beta_paid_maestro(); diff --git a/src/php-cli/batch/test_send_mail_to_overdated_maestro.php b/src/php-cli/batch/test_send_mail_to_overdated_maestro.php index 0bbda64..d0924c9 100644 --- a/src/php-cli/batch/test_send_mail_to_overdated_maestro.php +++ b/src/php-cli/batch/test_send_mail_to_overdated_maestro.php @@ -8,7 +8,7 @@ include __DIR__."/../../web/server/setup/connect_db.php"; include __DIR__."/../../web/php/mail/mail_setting.php"; include __DIR__."/../../web/server/mail/mail_contents.php"; include __DIR__."/../../web/server/lib/maestro_account_info.php"; -include __DIR__."/../../web/server/mail/send_naver_mail.php"; +include __DIR__."/../../web/server/mail/send_jinaju_mail.php"; $maestroList = null; $maestroList = get_overdated_maestro_list(); diff --git a/src/web/server/admin/extension_maestro.php b/src/web/server/admin/extension_maestro.php index a37abd0..af03baf 100644 --- a/src/web/server/admin/extension_maestro.php +++ b/src/web/server/admin/extension_maestro.php @@ -11,7 +11,7 @@ include "./../lib/maestro_log.php"; include './../mail/mail_setting.php'; include './../mail/mail_contents.php'; include './../lib/maestro_account_info.php'; -include "./../mail/send_naver_mail.php"; +include "./../mail/send_jinaju_mail.php"; $maestro_extension_id = $_POST["maestro_extension_id"]; $maestro_id = $_POST["maestro_id"]; diff --git a/src/web/server/admin/register_maestro.php b/src/web/server/admin/register_maestro.php index 091eb48..8b3e23f 100644 --- a/src/web/server/admin/register_maestro.php +++ b/src/web/server/admin/register_maestro.php @@ -12,7 +12,7 @@ include "./../lib/maestro_log.php"; include './../mail/mail_setting.php'; include './../mail/mail_contents.php'; include './../lib/maestro_account_info.php'; -include "./../mail/send_naver_mail.php"; +include "./../mail/send_jinaju_mail.php"; $maestroID = $_POST["maestro_id"]; diff --git a/src/web/server/admin/upgrade_maestro.php b/src/web/server/admin/upgrade_maestro.php index 52a08b0..5338f2b 100644 --- a/src/web/server/admin/upgrade_maestro.php +++ b/src/web/server/admin/upgrade_maestro.php @@ -10,7 +10,7 @@ include "./../mail/mail_setting.php"; include './../mail/mail_setting.php'; include './../mail/mail_contents.php'; include './../lib/maestro_account_info.php'; -include "./../mail/send_naver_mail.php"; +include "./../mail/send_jinaju_mail.php"; $maestro_upgrade_id = $_POST["maestro_upgrade_id"]; $maestro_id = $_POST["maestro_id"]; diff --git a/src/web/server/maestro/add_maestro.php b/src/web/server/maestro/add_maestro.php index 9acc898..a0666f9 100644 --- a/src/web/server/maestro/add_maestro.php +++ b/src/web/server/maestro/add_maestro.php @@ -12,7 +12,7 @@ include "./../lib/maestro_log.php"; include './../mail/mail_setting.php'; include './../mail/mail_contents.php'; include './../lib/maestro_account_info.php'; -include "./../mail/send_naver_mail.php"; +include "./../mail/send_jinaju_mail.php"; $maestro_name = $_POST["maestro_name"]; diff --git a/src/web/server/maestro/request_extension_maestro.php b/src/web/server/maestro/request_extension_maestro.php index 2664cc4..0d6a74f 100644 --- a/src/web/server/maestro/request_extension_maestro.php +++ b/src/web/server/maestro/request_extension_maestro.php @@ -8,7 +8,7 @@ include "./../lib/db_maestro.php"; include './../mail/mail_setting.php'; include './../mail/mail_contents.php'; include './../lib/maestro_account_info.php'; -include "./../mail/send_naver_mail.php"; +include "./../mail/send_jinaju_mail.php"; $maestro_id = $_POST["maestro_id"]; $available_date = $_POST["available_date"]; diff --git a/src/web/server/maestro/request_upgrade_maestro.php b/src/web/server/maestro/request_upgrade_maestro.php index 97435e2..073f972 100644 --- a/src/web/server/maestro/request_upgrade_maestro.php +++ b/src/web/server/maestro/request_upgrade_maestro.php @@ -8,7 +8,7 @@ include "./../lib/db_maestro.php"; include './../mail/mail_setting.php'; include './../mail/mail_contents.php'; include './../lib/maestro_account_info.php'; -include "./../mail/send_naver_mail.php"; +include "./../mail/send_jinaju_mail.php"; $maestro_id = $_POST["maestro_id"]; $registered_activate_status = $_POST["registered_activate_status"]; diff --git a/src/web/server/maestro/update_maestro_info.php b/src/web/server/maestro/update_maestro_info.php index 44cae02..5a52689 100644 --- a/src/web/server/maestro/update_maestro_info.php +++ b/src/web/server/maestro/update_maestro_info.php @@ -9,7 +9,7 @@ include "./../lib/maestro_log.php"; include './../mail/mail_setting.php'; include './../mail/mail_contents.php'; include './../lib/maestro_account_info.php'; -include "./../mail/send_naver_mail.php"; +include "./../mail/send_jinaju_mail.php"; $maestroID = $_POST["maestro_id"]; $maestroName = $_POST["maestro_name"]; diff --git a/src/web/server/mail/send_jinaju_mail.php b/src/web/server/mail/send_jinaju_mail.php new file mode 100644 index 0000000..d8fb04c --- /dev/null +++ b/src/web/server/mail/send_jinaju_mail.php @@ -0,0 +1,276 @@ +"; + + // global $from; // = "support+chocomae@jinaju.com"; + // global $bcc; // = "support+chocomae.automail@jinaju.com"; + + // mail sender info + global $sender_name; // = "초코마에"; + $sender_email = "support+chocomae@jinaju.com"; // = $from; + global $sender_address; // = $from; + global $sender_bcc; // = $bcc; + + $mail = new PHPMailer(true); + + try { + //Server settings + // $mail->SMTPDebug = SMTP::DEBUG_SERVER; // Enable verbose debug output + $mail->isSMTP(); // Send using SMTP + $mail->Host = 'smtp.gmail.com'; // Set the SMTP server to send through + $mail->SMTPAuth = true; // Enable SMTP authentication + $mail->Username = "support+chocomae@jinaju.com"; // SMTP username + $mail->Password = 'ixacckjjzvpugizl'; // SMTP password + $mail->CharSet = 'utf-8'; + $mail->Encoding = "base64"; + $mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; //Enable implicit TLS encryption +// $mail->SMTPSecure = "ssl"; + $mail->Port = 465; // TCP port to connect to, use 465 for `PHPMailer::ENCRYPTION_SMTPS` above + + + //Recipients + $mail->SetFrom($sender_email, $sender_name); + $mail->addAddress($maestro_email, $maestro_name); // Add a recipient + $mail->addReplyTo($sender_address, $sender_name); + $mail->addBCC($sender_bcc); + + // Content + $mail->isHTML(true); // Set email format to HTML + $mail->Subject = $subject; + $mail->Body = $body; + + $mail->send(); + + // set_data("message", "Message has been sent"); + // send_result_success(); + + return true; + } catch (Exception $e) { + // set_error_code("Message could not be sent. Mailer Error: {".$mail->ErrorInfo."}"); + // send_result_success(); + + return false; + } +} \ No newline at end of file diff --git a/src/web/server/mail/send_mail_test.php b/src/web/server/mail/send_mail_test.php index f851043..5bd278f 100644 --- a/src/web/server/mail/send_mail_test.php +++ b/src/web/server/mail/send_mail_test.php @@ -8,7 +8,7 @@ include "./../lib/db_maestro.php"; include './mail_setting.php'; include './mail_contents.php'; include './../lib/maestro_account_info.php'; -include "./send_naver_mail.php"; +include "./send_jinaju_mail.php"; $type = $_POST["type"]; $maestro_id = $_POST["maestro_id"];