-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmailscript.php
44 lines (37 loc) · 1.09 KB
/
mailscript.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
<?php
error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_STRICT);
ini_set('display_errors', 1);
include "classes/class.phpmailer.php";
//Receiver Info
$email = "[email protected]";
$name = "Satish";
//Sender Info
$sender_name = "";
$sender_email = "";
$sender_password = "";
$mail_subject = "Training Course Offers";
$message = "Hello, How are U..... :)";
$mail = new PHPMailer;
$mail->IsSMTP();
$mail->Host = "smtp.zoho.com";
$mail->Port = 465;
$mail->SMTPAuth = true;
$mail->SMTPDebug = 1;
$mail->SMTPSecure = "ssl";
$mail->Username = $sender_email;
$mail->Password = $sender_password;
$mail->AddReplyTo($sender_email, $sender_name);
$mail->SetFrom($sender_email,$sender_name);
$mail->Subject = $mail_subject;
$mail->AddAddress($email, $name);
$mail->MsgHTML($message);
$send = $mail->Send();
//$mail->AddAttachment("images/phpmailer.gif"); // attachment
//$mail->AddAttachment("images/phpmailer_mini.gif"); // attachment
if($send) {
$replay = 'Mail Sent';
} else {
$replay = $mail->ErrorInfo;
}
print_r($replay);
?>