Content-Type: text/html을 사용하여 mailx를 작동시키는 방법

Content-Type: text/html을 사용하여 mailx를 작동시키는 방법

mailx 명령을 사용하여 HTML 파일을 보내야 하는데 마크업 코드가 포함된 이메일을 받으면 다음과 같이 표시됩니다.

    <HTML><HEAD><TITLE>Title One /TITLE> <STYLE> body { width:900px; font-size: 10pt; font-family:verdana; 
.../...

나는 다음 명령을 사용했습니다.

cat file.html | mailx -r [email protected] -s "Suject" -S content_type=text/html -S smtp=smtp.acme.com  [email protected]

나는 또한 이것을 시도했다

cat file.html | mailx -a 'Content-Type: text/html' -r [email protected] -s "Suject" -S content_type=text/html -S smtp=smtp.acme.com  [email protected]

위의 마지막 오류 메시지가 표시됩니다.

Content-Type: text/html: No such file or directory

-a 옵션에 무엇이 빠졌나요?

답변1

내 mailx 버전은 다음과 같습니다: Heirloom mailx 12.5

이 명령은 내 문제를 해결했습니다.

(echo "Content-Type: text/html"; cat file.html ) | mailx -r [email protected] -s "Suject" -S content_type=text/html -S smtp=smtp.acme.com  [email protected]

관련 정보