Merge pull request 'feature/better-email' (#2) from feature/better-email into master
Reviewed-on: #2
This commit is contained in:
commit
67a39afe0f
57
mail.php
57
mail.php
@ -1,9 +1,14 @@
|
||||
<?php
|
||||
function send_mail($an, $betreff, $text, $ok = '', $error = '') {
|
||||
include 'secret.php';
|
||||
global $absender;
|
||||
$sender = 'noreply@troy-grunt.de';
|
||||
if (isset ( $_sendermail )) {
|
||||
$sender = $_sendermail;
|
||||
if(isset($absender) && $absender) {
|
||||
$sender = $absender;
|
||||
}else{
|
||||
include 'secret.php';
|
||||
if (isset ( $_sendermail )) {
|
||||
$sender = $_sendermail;
|
||||
}
|
||||
}
|
||||
$header = 'From: ' . $sender . "\r\n";
|
||||
$header .= 'To: ' . $an . "\r\n";
|
||||
@ -19,12 +24,18 @@ function send_mail($an, $betreff, $text, $ok = '', $error = '') {
|
||||
}
|
||||
|
||||
function send_html_mail($an, $betreff, $text, $ok = '', $error = '') {
|
||||
$boundary = md5($an.$betreff.$text.time());
|
||||
include 'secret.php';
|
||||
global $absender;
|
||||
$sender = 'noreply@troy-grunt.de';
|
||||
if (isset ( $_sendermail )) {
|
||||
$sender = $_sendermail;
|
||||
if(isset($absender) && $absender) {
|
||||
$sender = $absender;
|
||||
}else{
|
||||
include 'secret.php';
|
||||
if (isset ( $_sendermail )) {
|
||||
$sender = $_sendermail;
|
||||
}
|
||||
}
|
||||
$boundary = md5($an.$betreff.$text.time());
|
||||
|
||||
$header = 'From: ' . $sender . "\n";
|
||||
$header .= 'To: ' . $an . "\n";
|
||||
$header .= 'Content-Type:multipart/alternative;boundary='.$boundary . "\n";
|
||||
@ -46,4 +57,36 @@ function send_html_mail($an, $betreff, $text, $ok = '', $error = '') {
|
||||
}
|
||||
}
|
||||
|
||||
function send_php_mail($an, $betreff, $text, $ok = '', $error = '') {
|
||||
$boundary = md5($an.$betreff.$text.time());
|
||||
include 'secret.php';
|
||||
$sender = 'noreply@troy-grunt.de';
|
||||
if (isset ( $_sendermail )) {
|
||||
$sender = $_sendermail;
|
||||
}
|
||||
include 'php-mailer/SMTP.php';
|
||||
include 'php-mailer/PHPMailer.php';
|
||||
$mail = new PHPMailer();
|
||||
$mail->isSMTP();
|
||||
$mail->SMTPDebug = SMTP::DEBUG_OFF;
|
||||
$mail->Host = $_smtp['srv'];
|
||||
$mail->Port = 25;
|
||||
$mail->SMTPAuth = true;
|
||||
$mail->Username = $_smtp['user'];
|
||||
$mail->Password = $_smtp['pw'];
|
||||
|
||||
$mail->setFrom($sender);
|
||||
$mail->addAddress($an);
|
||||
$mail->Subject = $betreff;
|
||||
$mail->msgHTML('<html><body>'.$text.'</body></html>');
|
||||
$mail->AltBody = strip_tags($text);
|
||||
//$mail->addAttachment('images/phpmailer_mini.png');
|
||||
|
||||
if (!$mail->send()) {
|
||||
echo 'Mailer Error: ' . $mail->ErrorInfo;
|
||||
} else {
|
||||
echo 'Message sent!';
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
5058
php-mailer/PHPMailer.php
Normal file
5058
php-mailer/PHPMailer.php
Normal file
File diff suppressed because it is too large
Load Diff
1456
php-mailer/SMTP.php
Normal file
1456
php-mailer/SMTP.php
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,12 +1,15 @@
|
||||
<?php
|
||||
<?php
|
||||
if (!defined('SQL_LOG')) define ( 'SQL_LOG', 1 ); // schreibt sql querys in eine log
|
||||
|
||||
$_m['host'] = 'localhost';
|
||||
$_m['host'] = 'localhost';
|
||||
$_m['user'] = '';
|
||||
$_m['pass'] = '';
|
||||
$_m['data'] = '';
|
||||
$_m['pre'] = 'efcms2_';
|
||||
$_m['pre'] = '';
|
||||
$_m['salt'] = '';
|
||||
|
||||
$_sendermail = 'noreply@troy-grunt.de';
|
||||
$_sendermail = 'noreply@.de';
|
||||
$_smtp['srv'] = 'mail.seemsleg.it';
|
||||
$_smtp['user'] = 'noreply@.de';
|
||||
$_smtp['pw'] = '';
|
||||
?>
|
||||
Loading…
Reference in New Issue
Block a user