-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.php
48 lines (41 loc) · 1.25 KB
/
server.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
require __DIR__.'/../phpmailer/PHPMailerAutoload.php';
$username = 'Username or Email here';
$password = 'Password email';
$from = 'Sender here';
$fromName = 'Sender name';
$address = 'Address here';
$replyTo = 'Reply to';
$replyName = 'Reply name';
$subject = 'Subject here';
$content = 'Your message here';
$mail = new PHPMailer;
$mail->SMTPDebug = 2;
$mail->isSMTP();
$mail->Host = 'srv40.niagahoster.com';
$mail->SMTPAuth = true;
$mail->Username = $username;
$mail->Password = $password;
$mail->SMTPSecure = 'ssl';
$mail->Port = 465;
$mail->SMTPOptions = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
)
);
$mail->From = $from;
$mail->FromName = $fromName;
$mail->addAddress($address); // Add a recipient
$mail->addReplyTo($replyTo, $replyName);
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = $subject;
$mail->Body = $content;
if($mail->send()) {
echo 'email sent';
}
else {
echo 'failed';
}
?>