summaryrefslogtreecommitdiffstats
path: root/utils/smtp_test.php
blob: 2cf68f56ebb81c0d5b5162b1b0310967288a7e5b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php

/**
* skripta za testiranje smtp-ja
*/

include('../function.php');
include_once '../vendor/autoload.php';


$mail = new PHPMailer\PHPMailer\PHPMailer();

try {

	$mail->SMTPDebug = 2;

    // Server settings
    $mail->isSMTP();


	// Preveri in dopolni podatke!
    $mail->Host       = ''; // SMTP server
    $mail->SMTPAuth   = false; // Enable SMTP authentication
    $mail->Username   = ''; // SMTP username
    $mail->Password   = ''; // SMTP password
    $mail->SMTPSecure = ''; // tls, ssl...
    $mail->Port       = 25; // TCP port



    // Recipients
    $mail->setFrom('xxx@xxx.si', 'SMTP tester');
    $mail->addAddress('xxx@xxx.si');

    // Content
    $mail->isHTML(true);
    $mail->Subject = 'SMTP test';
    $mail->Body    = 'Testiranje 1ka emailov.';

    // Send the email
    $response = $mail->send();

	if($mail->ErrorInfo != '')
		echo '<br><br>'.$mail->ErrorInfo.'</br>';
} 
catch (Exception $e) {
    echo "Error: {$mail->ErrorInfo}";
}





?>