Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include("include/config.php");
- error_reporting(E_ALL);
- function mailer($sendto,$sendername,$from,$subject,$sendmailbody,$bcc="",$replyto="")
- {
- global $config;
- require($config['basedir'].'/mailer/PHPMailerAutoload.php');
- $mailer = new PHPMailer;
- $mailer->isSMTP();
- $mailer->Host = 'smtp.gmail.com';
- $mailer->SMTPAuth = true;
- $mailer->Username = 'noreply@p-store.net';
- $mailer->Password = 'plend123';
- $mailer->SMTPSecure = 'tls';
- $mailer->Port = 587;
- $mailer->isHTML(true);
- $mailer->setFrom($from, $sendername);
- $mailer->addAddress($sendto);
- if($bcc != "")
- {
- $mailer->addBCC($bcc);
- }
- if($replyto != "")
- {
- $mailer->addReplyTo($replyto);
- }
- $mailer->Subject = $subject;
- $mailer->Body = $sendmailbody;
- $status = @$mailer->send();
- $mailer->ClearAllRecipients();
- $mailer->ClearAddresses();
- $mailer->ClearAttachments();
- return $status;
- }
- $sendto = 'xxxxxxx@gmail.com';
- $sendername = 'Sender Name';
- $from = $config['site_email'];
- $replyto = 'xxxxx@company.com';
- $subject = "Subject";
- $sendmailbody = "Body";
- mailer($sendto,$sendername,$from,$subject,$sendmailbody,$bcc="",$replyto);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement