Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require 'PHPMailerAutoload.php';
- class SendMail{
- function mail($name, $to, $subject, $message) {
- $mail = new PHPMailer;
- $mail->SMTPDebug = 3; // Enable verbose debug output
- $mail->isSMTP(); // Set mailer to use SMTP
- $mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers
- $mail->SMTPAuth = true; // Enable SMTP authentication
- $mail->Username = 'care.prakashoffset@gmail.com'; // SMTP username
- $mail->Password = 'care@prakash'; // SMTP password
- $mail->SMTPSecure = 'ssl'; // Enable TLS encryption, `ssl` also accepted
- $mail->Port = 465; // TCP port to connect to
- $mail->From = 'info@prakashoffset.com';
- $mail->FromName = 'Prakash Offset';
- $mail->addAddress($to); // Add a recipient
- $mail->addReplyTo('info@prakashoffset.com', 'reply');
- // $mail->addCC('cc@example.com');
- // $mail->addBCC('bcc@example.com');
- $mail->isHTML(true); // Set email format to HTML
- $mail->Subject = $subject;
- $mail->Body = $message;
- /*$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';*/
- if(!$mail->send()) {
- return false;
- } else {
- return true;
- }
- }
- }
Add Comment
Please, Sign In to add comment