Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function sendMail($mail, $maildata) {
- try {
- $mail->SMTPDebug = 2;
- $mail->isSMTP();
- $mail->Host = 'smtp.office365.com';
- $mail->SMTPAuth = true;
- $mail->Username = 'x@x.co.uk';
- $mail->Password = "x";
- $mail->SMTPSecure = 'tls';
- $mail->Port = 587;
- $mail->setFrom('x@x.com');
- $mail->addAddress($maildata['email']);
- ob_start();
- include('email_template.php');
- $message = ob_get_contents();
- ob_end_clean();
- $mail->isHTML(true);
- $mail->Subject = 'x';
- $mail->Body = $message;
- $mail->send();
- return 1;
- } catch (Exception $e) {
- return 0;
- }
- }
Add Comment
Please, Sign In to add comment