HP-UX mailx傳送郵件出現中文亂碼問題
cat filename | mailx -s "subject" lilianjia@zking.com
上面命令在傳送filename檔案內容中存在中文的時候會在Outlook中出現亂碼,檢視mail頭發現存在“charset="us-ascii",說明郵件使用us-ascii字符集解析了。
解決方法:在mailx命令加上-m引數
cat filename | mailx -m -s "subject" lilianjia@zking.com
-m 引數的意義
-m Do not add MIME header lines Mime Version, Content
Type & Content Encoding to the header information
while sending mails.
確認下效果,不加-m引數的mail頭部:
Received: from zjop01.zking.com (88.0.33.4) by ZJ-MAIL01.zking.com (88.0.64.2)
with Microsoft SMTP Server id 8.0.685.24; Wed, 22 Apr 2009 13:37:22 +0800
Received: (from oraywzkr@localhost) by zjop01.zking.com (8.11.1
(PHNE_35951)/8.11.1) id n3M5bMr07169 for lilianjia@zking.com; Wed, 22 Apr
2009 13:37:22 +0800 (EAT)
Date: Wed, 22 Apr 2009 13:37:22 +0800
From:
Message-ID: <200904220537.n3M5bMr07169@zjop01.zking.com>
To: lilianjia@zking.com
Subject: full_backup_200904220010.log
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 8bit
Return-Path: oraywzkr@zjop01.zking.com
加上-m引數的mail頭部:
Received: from zjop01.zking.com (88.0.33.4) by ZJ-MAIL01.zking.com (88.0.64.2)
with Microsoft SMTP Server id 8.0.685.24; Wed, 22 Apr 2009 14:29:21 +0800
Received: (from oraywzkr@localhost) by zjop01.zking.com (8.11.1
(PHNE_35951)/8.11.1) id n3M6TLc12667 for lilianjia@zking.com; Wed, 22 Apr
2009 14:29:21 +0800 (EAT)
Date: Wed, 22 Apr 2009 14:29:21 +0800
From:
Message-ID: <200904220629.n3M6TLc12667@zjop01.zking.com>
To: lilianjia@zking.com
Subject: full_backup_200904220010.log
MIME-Version: 1.0
Content-Type: text/plain
Return-Path: oraywzkr@zjop01.zking.com
郵件內容不再使用us-ascii解析,自然就沒有亂碼了。
發附件的方法:
uuencode filename filename | mailx -m -s "subject" lilianjia@zking.com
此處也必須加上-m引數,否則郵件會以亂碼的內容發出來。
上面命令在傳送filename檔案內容中存在中文的時候會在Outlook中出現亂碼,檢視mail頭發現存在“charset="us-ascii",說明郵件使用us-ascii字符集解析了。
解決方法:在mailx命令加上-m引數
cat filename | mailx -m -s "subject" lilianjia@zking.com
-m 引數的意義
-m Do not add MIME header lines Mime Version, Content
Type & Content Encoding to the header information
while sending mails.
確認下效果,不加-m引數的mail頭部:
Received: from zjop01.zking.com (88.0.33.4) by ZJ-MAIL01.zking.com (88.0.64.2)
with Microsoft SMTP Server id 8.0.685.24; Wed, 22 Apr 2009 13:37:22 +0800
Received: (from oraywzkr@localhost) by zjop01.zking.com (8.11.1
(PHNE_35951)/8.11.1) id n3M5bMr07169 for lilianjia@zking.com; Wed, 22 Apr
2009 13:37:22 +0800 (EAT)
Date: Wed, 22 Apr 2009 13:37:22 +0800
From:
Message-ID: <200904220537.n3M5bMr07169@zjop01.zking.com>
To: lilianjia@zking.com
Subject: full_backup_200904220010.log
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 8bit
Return-Path: oraywzkr@zjop01.zking.com
加上-m引數的mail頭部:
Received: from zjop01.zking.com (88.0.33.4) by ZJ-MAIL01.zking.com (88.0.64.2)
with Microsoft SMTP Server id 8.0.685.24; Wed, 22 Apr 2009 14:29:21 +0800
Received: (from oraywzkr@localhost) by zjop01.zking.com (8.11.1
(PHNE_35951)/8.11.1) id n3M6TLc12667 for lilianjia@zking.com; Wed, 22 Apr
2009 14:29:21 +0800 (EAT)
Date: Wed, 22 Apr 2009 14:29:21 +0800
From:
Message-ID: <200904220629.n3M6TLc12667@zjop01.zking.com>
To: lilianjia@zking.com
Subject: full_backup_200904220010.log
MIME-Version: 1.0
Content-Type: text/plain
Return-Path: oraywzkr@zjop01.zking.com
郵件內容不再使用us-ascii解析,自然就沒有亂碼了。
發附件的方法:
uuencode filename filename | mailx -m -s "subject" lilianjia@zking.com
此處也必須加上-m引數,否則郵件會以亂碼的內容發出來。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/11411056/viewspace-733493/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 郵件傳送時的亂碼問題
- 傳送郵件出現問題
- 解決jenkins 傳送郵件圖片亂碼問題Jenkins
- 怎麼透過mailx向內部郵件伺服器傳送郵件?(疑問板)AI伺服器
- 微信公眾號傳送模板訊息,出現亂碼問題---字元中文編碼問題字元
- 怎麼透過mailx向內部郵件伺服器傳送郵件?(解答)AI伺服器
- Laravel 傳送純文字郵件時提示亂碼Laravel
- 請教:如何解決JAVAMAIL傳送html格式郵件時的亂碼問題JavaAIHTML
- mailx 或telnet 使用指定SMTP伺服器傳送郵件AI伺服器
- mailx 使用ssl郵件傳送配置 2018-12-28AI
- java httpclient傳送中文亂碼JavaHTTPclient
- 郵件傳送庫原始碼原始碼
- 郵件傳送
- 傳送郵件
- foxmail能收郵件,但是無法傳送郵件的問題AI
- 在python中傳送郵件亂碼了怎麼辦?Python
- Java實現QQ郵件傳送郵件工具類Java
- 谷歌郵箱,配置傳送郵件密碼谷歌密碼
- oracle 傳送郵件 實現方法Oracle
- Django實現傳送郵件功能Django
- 用Perl實現郵件傳送
- python實現傳送郵件Python
- laravel傳送啟用郵件的思路和問題Laravel
- laravel 傳送郵件修改密碼Laravel密碼
- SpringBoot整合Mail傳送郵件&傳送模板郵件Spring BootAI
- 用 apache commons-email 輕鬆傳送無亂碼郵件ApacheAI
- Laravel 傳送郵件Laravel
- PHP傳送郵件PHP
- Django——郵件傳送Django
- java郵件傳送Java
- Laravel傳送郵件Laravel
- gmail傳送郵件AI
- Oracle郵件傳送Oracle
- java傳送郵件Java
- Powershell郵件傳送
- thinkphp 郵件傳送PHP
- centos 傳送郵件CentOS
- phpcms傳送郵件PHP