Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- include_once("phpmailer/PHPMailerAutoload.php");
- $account="xxxxxxx@xxxxxxxx.com";
- $password="xxxx";
- if (!isset($mail)) {
- $mail = new PHPMailer();
- $mail->SMTPDebug = 2;
- $mail->IsSMTP();
- $mail->CharSet = "UTF-8";
- $mail->Host = "smtp.office365.com";
- $mail->SMTPAuth= true;
- $mail->Port = 587;
- $mail->From = $account;
- $mail->Username= $account;
- $mail->Password= $password;
- $mail->SMTPSecure = 'tls';
- $mail->SMTPOptions = array(
- 'ssl' => array(
- 'verify_peer' => false,
- 'verify_peer_name' => false,
- 'allow_self_signed' => true
- )
- );
- }
- $mail->ClearAllRecipients();
- $to = 'xxxxxxxxx@gmail.com';
- $nombre = 'to';
- $mail->addAddress($to, $nombre);
- $mail->FromName = "ENTERPRISE";
- $mail->isHTML(true);
- $mail->Subject = 'SUBJECT: TEST';
- $cuerpo = 'TEST';
- $mail->MsgHTML($body);
- $mail->Body = $body;
- $mail->AltBody = 'TEST';
- if(!$mail->send()) {
- echo 'Mailer Error: ' . $mail->ErrorInfo;
- } else {
- echo true;
- }
Add Comment
Please, Sign In to add comment