-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmail.php
More file actions
53 lines (40 loc) · 1.38 KB
/
mail.php
File metadata and controls
53 lines (40 loc) · 1.38 KB
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
<?php
require_once 'PHPMailer/PHPMailerAutoload.php';
function smtpmailer($to, $from, $from_name, $subject, $body)
{
$mail = new PHPMailer();
$mail -> SMTPDebug = 4;
$mail ->IsSMTP();
$mail ->SMTPAuth = true;
$mail -> SMTPSecure = 'ssl';
$mail -> Host = 'mail.landlordng.com';
$mail -> Port = 465;
$mail -> username = 'support@blandlordng.com';
$mail -> Password = '.......';
$mail -> IsHTML(true);
$mail -> From ="";
$mail -> FromName='my west' ;
$mail -> Sender = 'support@blandlord.com' ;
$mail -> AddReplyTo($from, $from_name);
$mail -> Subject = $subject;
$mail -> Body = $body;
$mail -> AddAddress($to);
if(!$mail->Send())
{
// echo '<script>alert("please try again, error occured")</script>';
$error ="please try again, error occured";
echo $mail->ErrorInfo;
}
else{
//echo 'thanks mail sent';
$error = "thanks mail sent ";
echo $error ;
}
}
$to = 'westwizo@gmail.com';
$from = '.........';
$name ='bitzone';
$subject ='mail testing';
$msg = 'heiya it works';
$error = smtpmailer($to,$from,$name,$subject,$msg);
?>