-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathmail.php
57 lines (48 loc) · 1.56 KB
/
mail.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
49
50
51
52
53
54
55
56
57
<?php
require "PHPMailer/PHPMailerAutoload.php";
function smtpmailer($to, $from, $from_name, $subject, $body)
{
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->SMTPSecure = 'ENTER SMTP PROTOCOL';
$mail->Host = 'ENTER SMTP SERVER HOST NAME';
$mail->Port = ENTER SMTP PORT NUMBER;
$mail->Username = 'ENTER YOUR MAIL ID';
$mail->Password = 'ENTER YOUR EMAIL PASSWORD';
// $path = 'reseller.pdf';
// $mail->AddAttachment($path);
$mail->IsHTML(true);
$mail->From="ENTER FROM EMAIL ADDRESS HERE";
$mail->FromName=$from_name;
$mail->Sender=$from;
$mail->AddReplyTo($from, $from_name);
$mail->Subject = $subject;
$mail->Body = $body;
$mail->AddAddress($to);
if(!$mail->Send())
{
$error ="Please try Later, Error Occured while Processing...";
return $error;
}
else
{
$error = "Thanks You !! Your email is sent.";
return $error;
}
}
$to = '';
$from = '';
$name = '';
$subj = 'PHPMailer 5.2 testing from DomainRacer';
$msg = 'This is mail about testing mailing using PHP.';
$error=smtpmailer($to,$from, $name ,$subj, $msg);
?>
<html>
<head>
<title>PHPMailer 5.2 testing from DomainRacer</title>
</head>
<body style="background: black;">
<center><h2 style="padding-top:70px;color: white;"><?php echo $error; ?></h2></center>
</body>
</html>