-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathsendmail.php
32 lines (27 loc) · 972 Bytes
/
sendmail.php
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
// Uses PEAR's Mail class - usually part of a standard PHP installation, otherwise get it from here:
// https://pear.php.net/package/Mail
<?php
require_once "Mail.php";
$from = '[email protected]'; // CHANGE THIS!
$to = '[email protected]'; // CHANGE THIS!
$subject = 'Robotan ' . htmlspecialchars($_GET["error"]);
$body = $subject;
$headers = array(
'From' => $from,
'To' => $to,
'Subject' => $subject
);
$smtp = Mail::factory('smtp', array(
'host' => 'smtp-server.de', // CHANGE THIS!
'port' => '587', // You might have to change this
'auth' => true, // You might have to change this
'SMTPAuth' => 'tls', // You might have to change this
'username' => 'Username', // CHANGE THIS!
'password' => 'Passwort' // CHANGE THIS!
));
$mail = $smtp->send($to, $headers, $body);
// Send the mail
print "Sending mail...<BR>\n";
$mail = $smtp->send($to, $headers, $body);
print "Return value: $mail<BR>\nDone.\n";
?>