Advertisement
Guest User

Untitled

a guest
Dec 19th, 2016
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.92 KB | None | 0 0
  1. require_once( './PHPMailer-master/PHPMailerAutoload.php');
  2. $mail = new PHPMailer();
  3. $mail->isSMTP(); // Set mailer to use SMTP
  4. $mail->Host = 'smtp.office365.com';
  5. $mail->ClearReplyTos();
  6. $mail->addReplyTo($organizer_email, $organizer);// Specify main and backup server
  7. $mail->SetFrom('xyx@xyx.com', 'zyx');
  8. $mail->SMTPAuth = tls; // Enable SMTP authentication
  9. $mail->Username = 'xyz@xyz.com'; // SMTP username
  10. $mail->Password = 'xyzzzzz'; // SMTP password
  11. $mail->SMTPSecure = 'tls'; // Enable encryption, 'ssl' also accepted
  12. $mail->Port = 587; //Set the SMTP port number - 587 for authenticated TLS
  13. $mail->addAddress($organizer_email); // Add a recipient
  14. $content = file_get_contents($resume_attach_path);
  15. $content = chunk_split(base64_encode($content));
  16. $eol = "rn";
  17. $tags = explode(',', $to);
  18. foreach ($tags as $tag) {
  19. $mail->addCC($tag);
  20. }
  21. $mail->WordWrap = 50;
  22. // Set word wrap to 50 characters
  23. $headers = "From: xyzn";
  24. $headers .= 'Content-Type:text/calendar; Content-Disposition: inline; charset=utf-8;rn';
  25. $headers .= "Content-Type: text/plain;charset="utf-8"rn"; #EDIT: TYPO
  26. $mail->Subject = $subject;
  27. $mail->Body = $desc;
  28. $mail->AltBody = $text; // in your case once more the $text string
  29. $mail->Ical = $text; // ical format, in your case $text string
  30. $mail->isHTML(true); // Set email format to HTML
  31. $mail->msgHTML(file_get_contents('contents.doc'), $resume_attach_path);
  32. //Replace the plain text body with one created manually
  33. $mail->AltBody = 'This is a plain-text message body';
  34. //Attach an resume document or pdf file
  35. $mail->addAttachment($resume_attach_path);
  36. if ($mail->send()) {
  37. return true;
  38. }else{
  39. return false;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement