PHP를 사용하여 사진과 CSS 스타일 시트가 포함 된 전자 메일로 HTML 페이지를 보내려고합니다. 어떻게 서버에 이미지를 업로드하지 않고 내 이미지와 CSS 스타일 시트를 추가 할 수 있습니까?PHP를 통해 이메일에 HTML 페이지 보내기
<?php
$to = "[email protected]";
// subject
$subject = "Test mail";
// message
$message = file_get_contents("index.html"); // index.html contains images and css stylesheet which are not displayin in the email
// from
$from = "[email protected]";
// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
$headers .= "From:" . $from;
// Mail it
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?>
내가 크게 도움을 주셔서 감사합니다 :
다음은 sendind 이메일에 대한 PHP 코드입니다. 미리 감사드립니다.
정말 원하는대로 작동하지 않을 것이라고 생각합니다. 대부분의 이메일 클라이언트는 원하는대로 이메일을 표시하지 않습니다. – putvande
이미지가 서버에없는 경우 어떻게 참조 할 수 있습니까? 이미지는 서버에 있어야합니다. –
이미지에 절대 경로 사용 및 적용시 인라인 스타일을 지정해야합니다. CSS는 이메일에서 지원되지 않습니다. – Anup