Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $output[] = array('message' => '1');
- // Start email
- $mail = new PHPMailer;
- $mail->isSMTP();
- $mail->SMTPDebug = 0;
- //$mail->Debugoutput = 'html';
- $mail->IsHTML(true);
- $mail->Host = 'smtp.gmail.com';
- $mail->Port = 587;
- $mail->SMTPSecure = 'tls';
- $mail->SMTPAuth = true;
- $mail->Username = "******";
- $mail->Password = "******";
- $mail->setFrom('mail@mail.com', 'Sender');
- $mail->addAddress('mail@mail.com', 'Receiver');
- $mail->Subject = 'Sent';
- //$mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__));
- $mail->AltBody = 'This is a plain-text message body';
- $mail->Body = 'Sent';
- //$mail->addAttachment('images/phpmailer_mini.png');
- if(!$mail->send()) {
- //echo json_encode(['status' => false, 'message' => 'Message could not be sent. Error: ' . $mail->ErrorInfo]);
- echo 'Email error' .$mail->ErrorInfo;
- }
- else
- {
- echo json_encode($output);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement