Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require_once( './PHPMailer-master/PHPMailerAutoload.php');
- $mail = new PHPMailer();
- $mail->isSMTP(); // Set mailer to use SMTP
- $mail->Host = 'smtp.office365.com';
- $mail->ClearReplyTos();
- $mail->addReplyTo($organizer_email, $organizer);// Specify main and backup server
- $mail->SetFrom('xyx@xyx.com', 'zyx');
- $mail->SMTPAuth = tls; // Enable SMTP authentication
- $mail->Username = 'xyz@xyz.com'; // SMTP username
- $mail->Password = 'xyzzzzz'; // SMTP password
- $mail->SMTPSecure = 'tls'; // Enable encryption, 'ssl' also accepted
- $mail->Port = 587; //Set the SMTP port number - 587 for authenticated TLS
- $mail->addAddress($organizer_email); // Add a recipient
- $content = file_get_contents($resume_attach_path);
- $content = chunk_split(base64_encode($content));
- $eol = "rn";
- $tags = explode(',', $to);
- foreach ($tags as $tag) {
- $mail->addCC($tag);
- }
- $mail->WordWrap = 50;
- // Set word wrap to 50 characters
- $headers = "From: xyzn";
- $headers .= 'Content-Type:text/calendar; Content-Disposition: inline; charset=utf-8;rn';
- $headers .= "Content-Type: text/plain;charset="utf-8"rn"; #EDIT: TYPO
- $mail->Subject = $subject;
- $mail->Body = $desc;
- $mail->AltBody = $text; // in your case once more the $text string
- $mail->Ical = $text; // ical format, in your case $text string
- $mail->isHTML(true); // Set email format to HTML
- $mail->msgHTML(file_get_contents('contents.doc'), $resume_attach_path);
- //Replace the plain text body with one created manually
- $mail->AltBody = 'This is a plain-text message body';
- //Attach an resume document or pdf file
- $mail->addAttachment($resume_attach_path);
- if ($mail->send()) {
- return true;
- }else{
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement