· 9 years ago · Oct 21, 2016, 07:40 PM
1
2require('PHPMailerAutoload.php');
3
4$mail = new PHPMailer;
5
6//$mail->SMTPDebug = 3; // Enable verbose debug output
7
8$mail->isSMTP(); // Set mailer to use SMTP
9$mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers
10$mail->SMTPAuth = true; // Enable SMTP authentication
11$mail->Username = '@gmail.com'; // SMTP username
12$mail->Password = ''; // SMTP password
13$mail->SMTPSecure = 'ssl'; // Enable TLS encryption, `ssl` also accepted
14$mail->Port = 465; // TCP port to connect to
15
16$mail->From = 'lecoindesaigues@gmail.com';
17$mail->FromName = 'Le Coin des Aigues';
18//$mail->addAddress('joe@example.net', 'Joe User'); // Add a recipient
19
20$mail->addReplyTo('lecoindesaigues@gmail.com', 'Le Coin des Aigues');
21//$mail->addCC('cc@example.com');
22//$mail->addBCC('bcc@example.com');
23
24//$mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
25//$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
26$mail->isHTML(true);