Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stan.smith@americandadcia.fx, Stan Smith
- function SendEmail($to,$fromName, $subject, $message)
- {
- date_default_timezone_set('Etc/UTC');
- $mail = new PHPMailer;
- $mail->isSMTP();
- $mail->SMTPDebug = 2;
- $mail->Debugoutput = 'html';
- $mail->Host = smtp_host;
- $mail->Port = smtp_port;
- $mail->SMTPSecure = smtp_protocol;
- $mail->SMTPAuth = true;
- $mail->Username = smtp_user;
- $mail->Password = smtp_pass;
- $mail->setFrom(smtp_user, $fromName);
- $mail->addReplyTo(smtp_user, $fromName);
- $mail->addAddress($to);
- $mail->Subject = $subject;
- $mail->msgHTML($message);
- $mail->send();
- if (!$mail->send()) {
- echo "Mailer Error: " . $mail->ErrorInfo;
- }
- }
- stan.smith@americandad.fx, Stan Smith; roger.smith@amongyou.ufo, Roger Smith; francine.smith@desperatehousewives.fox, Francine Smith
- $mail = new MailSystem();
- $emails=$_POST['emailTo'];
- $email=explode(";",$emails);
- foreach($email as $address) {
- echo $mail->SendEmail($address, SITE_NAME." Newsletter", $_POST['emailSubject'], $_POST['emailBody']);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement