-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsendmail.php
40 lines (34 loc) · 993 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
33
34
35
36
37
38
39
40
<?php
function email($to,$firstname,$subject,$body){
require('PHPMailer/PHPMailerAutoload.php');
$mail = new PHPMailer;
$mail->isSMTP();
$mail->SMTPDebug = 0;
$mail->SMTPOptions = array (
'ssl' => array (
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
)
);
$mail->Debugoutput = 'html';
$mail->Host = 'smtp.gmail.com';
$mail->Port = 465;
$mail->SMTPSecure = 'ssl';
$mail->SMTPAuth = true;
$mail->SMTPKeepAlive = true;
$mail->Mailer = "smtp";
$mail->Username = "hewittvs@gmail.com";
$mail->Password = "hwttwhvs123";
//Set who the message is to be sent from
$mail->setFrom('admin@registoder.com', 'Admin@Courec.com');
//Set an alternative reply-to address
$mail->addReplyTo('hewittvs@gmail.com', 'Admin@Courec.com');
//Set who the message is to be sent to
$mail->addAddress($to,$firstname);
//Set the subject line
$mail->Subject = $subject;
$mail->Body = $body;
$mail->send();
}
?>