From 33b73f56aa40b416c9d18fd7d7ef6f2317188b39 Mon Sep 17 00:00:00 2001 From: Xenomporio <> Date: Tue, 28 Jun 2022 17:01:23 +0200 Subject: [PATCH] Improvement of emailbackup page including button for SMTP test --- www/pages/content/emailbackup_edit.tpl | 160 ++++++++++++++++++------- www/pages/emailbackup.php | 39 +++++- 2 files changed, 152 insertions(+), 47 deletions(-) diff --git a/www/pages/content/emailbackup_edit.tpl b/www/pages/content/emailbackup_edit.tpl index 9eef7d3c..e91ed189 100644 --- a/www/pages/content/emailbackup_edit.tpl +++ b/www/pages/content/emailbackup_edit.tpl @@ -13,60 +13,128 @@
+ diff --git a/www/pages/emailbackup.php b/www/pages/emailbackup.php index 9c09a3de..94f4c15b 100644 --- a/www/pages/emailbackup.php +++ b/www/pages/emailbackup.php @@ -18,6 +18,8 @@ class Emailbackup { $this->app->ActionHandler("create", "emailbackup_edit"); // This automatically adds a "New" button $this->app->ActionHandler("edit", "emailbackup_edit"); $this->app->ActionHandler("delete", "emailbackup_delete"); + $this->app->ActionHandler("test_smtp",'emailbackup_test_smtp'); + $this->app->DefaultActionHandler("list"); $this->app->ActionHandlerListen($app); } @@ -203,8 +205,8 @@ $width = array('10%'); // Fill out manually later $input['smtp_extra'] = $this->app->Secure->GetPOST('smtp_extra'); $input['smtp_ssl'] = $this->app->Secure->GetPOST('smtp_ssl'); $input['smtp_port'] = $this->app->Secure->GetPOST('smtp_port'); - $input['smtp_frommail'] = $this->app->Secure->GetPOST('smtp_frommail'); - $input['smtp_fromname'] = $this->app->Secure->GetPOST('smtp_fromname'); + $input['smtp_frommail'] = $this->app->Secure->GetPOST('email'); // use only these + $input['smtp_fromname'] = $this->app->Secure->GetPOST('angezeigtername'); // use only these $input['client_alias'] = $this->app->Secure->GetPOST('client_alias'); $input['smtp_authtype'] = $this->app->Secure->GetPOST('smtp_authtype'); $input['smtp_authparam'] = $this->app->Secure->GetPOST('smtp_authparam'); @@ -255,8 +257,6 @@ $width = array('10%'); // Fill out manually later $this->app->Tpl->Set('SMTP_EXTRA', $input['smtp_extra']); $this->app->Tpl->Set('SMTP_SSL', $input['smtp_ssl']); $this->app->Tpl->Set('SMTP_PORT', $input['smtp_port']); - $this->app->Tpl->Set('SMTP_FROMMAIL', $input['smtp_frommail']); - $this->app->Tpl->Set('SMTP_FROMNAME', $input['smtp_fromname']); $this->app->Tpl->Set('CLIENT_ALIAS', $input['client_alias']); $this->app->Tpl->Set('SMTP_AUTHTYPE', $input['smtp_authtype']); $this->app->Tpl->Set('SMTP_AUTHPARAM', $input['smtp_authparam']); @@ -270,4 +270,35 @@ $width = array('10%'); // Fill out manually later } + function emailbackup_test_smtp() { + + $id = $this->app->Secure->GetGET('id'); + + $result = $this->app->DB->SelectArr("SELECT angezeigtername, email FROM emailbackup WHERE id='$id' LIMIT 1"); + + if( + $this->app->erp->MailSend( + $result[0]['email'], + $result[0]['angezeigtername'], + $result[0]['email'], + $result[0]['angezeigtername'], + 'Xenomporio ERP: Testmail', + 'Dies ist eine Testmail', + '',0,true,'','', + true + ) + ) { + $msg = $this->app->erp->base64_url_encode( + '