Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function mailTo ( $emails, $subject, $message ) {
- $mail = new PHPMailer;
- $mail->isSMTP();
- $mail->isHTML(true);
- $mail->setFrom( SITE_EMAIL, SITE_NAME );
- $mail->Host = 'smtp.gmail.com';
- $mail->SMTPAuth = true;
- $mail->Username = SMTP_LOGIN;
- $mail->Password = SMTP_PASS;
- $mail->SMTPSecure = 'ssl';
- $mail->Port = 465;
- if ( !is_array($emails) ) $emails = [ $emails ];
- foreach ( $emails as $key ) $mail->addAddress( $key );
- $mail->Subject = $subject;
- $mail->Body = $message;
- return ( $mail->send() ) ? true : false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement