Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Test_IdP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Trust and Identity Incubator
Test_IdP
Commits
d4459d3f
Commit
d4459d3f
authored
3 years ago
by
Martin van Es
Browse files
Options
Downloads
Patches
Plain Diff
Remove phpmailer.php conf
parent
bcf07fc6
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitignore
+1
-1
1 addition, 1 deletion
.gitignore
testidp/phpmailer.php
+0
-55
0 additions, 55 deletions
testidp/phpmailer.php
with
1 addition
and
56 deletions
.gitignore
+
1
−
1
View file @
d4459d3f
.env
.env
cert/
cert/
wildcard*
This diff is collapsed.
Click to expand it.
testidp/phpmailer.php
deleted
100644 → 0
+
0
−
55
View file @
bcf07fc6
<?php
use
PHPMailer\PHPMailer\PHPMailer
;
use
PHPMailer\PHPMailer\Exception
;
require_once
(
APP_BASE_DIR
.
'/classes/phpmailer/Exception.php'
);
require_once
(
APP_BASE_DIR
.
'/classes/phpmailer/PHPMailer.php'
);
require_once
(
APP_BASE_DIR
.
'/classes/phpmailer/SMTP.php'
);
class
custom_phpmailer
{
public
function
__construct
()
{
}
public
static
function
send_email
(
$to
,
$to_name
=
''
,
$subject
=
'Message from Test IDP portal'
,
$message
,
$success
=
'Your account registration is pending'
)
{
$mail
=
new
PHPMailer
;
$mail
->
CharSet
=
"UTF-8"
;
$mail
->
isSMTP
();
$mail
->
SMTPDebug
=
0
;
// 0 = off (for production use) - 1 = client messages - 2 = client and server messages
//$mail->Host = "smtp.gmail.com"; // use $mail->Host = gethostbyname('smtp.gmail.com'); // if your network does not support SMTP over IPv6
$mail
->
Host
=
"in-v3.mailjet.com"
;
//$mail->Port = 465; // TLS only
$mail
->
Port
=
587
;
// TLS only
//$mail->SMTPSecure = 'ssl'; // ssl is deprecated
$mail
->
SMTPAuth
=
true
;
//$mail->Username = 'geant.incubator@gmail.com';
$mail
->
Username
=
'eaa84e1afc080e61cdf87e021b2b3f8e'
;
//$mail->Password = '=xtJEq&>+]TS&qu7-719}B{E[4';
$mail
->
Password
=
'f444618af6955a1aba1c29f219fe6746'
;
//$mail->setFrom('noreply@testidp.incubator.geant.org', 'Test IDP portal');
$mail
->
setFrom
(
'tikrasseo@gmail.com'
,
'Test IDP portal'
);
if
(
security
::
check_request_data
(
$to_name
))
{
$mail
->
addAddress
(
$to
,
$to_name
);
}
else
{
$mail
->
addAddress
(
$to
);
}
$mail
->
Subject
=
$subject
;
/*
$from_ip = '';
if(filter_var('', FILTER_VALIDATE_IP)) {
$from_ip = @$_SERVER['HTTP_CLIENT_IP'];
} elseif(filter_var('', FILTER_VALIDATE_IP)) {
$from_ip = @$_SERVER['HTTP_X_FORWARDED_FOR'];
} else {
$from_ip = @$_SERVER['REMOTE_ADDR'];
}
$message .= '<br />Sent from IP: '.$from_ip;
*/
$mail
->
msgHTML
(
$message
);
//$mail->msgHTML(file_get_contents('contents.html'), __DIR__); //Read an HTML message body from an external file, convert referenced images to embedded,
$mail
->
AltBody
=
strip_tags
(
str_replace
(
'<br />'
,
"
\n\r
"
,
$message
));
if
(
!
$mail
->
send
()){
return
security
::
format_message
(
"ERROR:Įvyko klaida siunčiant el. laišką. Prašome kreiptis į administratorių."
);
}
else
{
return
$success
;
}
}
}
?>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment