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('[email protected]', 'zyx');
$mail->SMTPAuth = tls; // Enable SMTP authentication
$mail->Username = '[email protected]'; // 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 = "\r\n";
$tags = explode(',', $to);
foreach ($tags as $tag) {
$mail->addCC($tag);
}
$mail->WordWrap = 50;
$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->addStringAttachment($resume_attach_path,'base64');
if ($mail->send()) {
return true;
}else{
return false;
}
난 그냥 iCal을 초대 볼 수없는 첨부 파일을 볼 수 있습니다,하지만 난 첨부 파일을 제거하면 내가 어떻게 보낼 수 있으며, iCal을 초대 볼 수 addAttachment를 사용하는 경우 phpmailer의 인라인 및 외부 문서 첨부.phpmailer
헤더 및 콘텐츠 인코딩이 엉망이되는 이유는 무엇입니까? PHPMailer가 모든 것을 제공합니다. 'addAttachment'와'addEmbeddedAttachment'를 호출 할 수 있습니다. 보낸 사람 주소를 설정하지 않았습니다. 'clearReplyTos'를 호출 할 필요가 없습니다. 'msgHTML'을 호출하면'Body'와'AltBody'를 모두 덮어 씁니다. 그래서 미리 설정해 둘 필요가 없습니다. [documentation] (https://github.com/PHPMailer/PHPMailer/wiki)에 대한 기본적인 내용은 도움이 될 것입니다. – Synchro
샘플 코드를 표시 할 수 있습니까 @ 싱크로 – dude
PHPMailer와 함께 제공되는 샘플을보고 문서에 설명되어 있습니다. 아무런 차이가 없습니다. 단순히 임의의 함수를 호출하거나, 임의의 문자열을 설정하거나, 임의의 인코딩을 적용하지 말고, 수행중인 작업에 약간의 논리 만 적용하면됩니다. – Synchro