纯文本邮件? [英] Plain text email?
问题描述
我做的格式化(主要有标签)。简报,我想
能够发送SMTP邮件,接收者只能以纯文本形式获取。
2005年6月27日15:38:59 -0700,Inkiniteo< ga **** @ gmail.com>写道:大家好。我有一个通过电子邮件发送信息的脚本,但我想通过电子邮件客户端或Gmail避免转换为HTML,因为它会破坏我所做的所有格式化(使用标签,大多)。简报,我想能够发送SMTP邮件,而收件人只能以纯文本形式发送。
你能给出一个简短的例子吗?你是如何建立电子邮件的?
2005年6月27日15:38:59 -0700,谣言说Inkiniteo
< GA **** @ gmail.com>可能写得:
大家好。我有一个通过电子邮件发送信息的脚本,但我想通过电子邮件客户端或Gmail避免转换为HTML,因为它会破坏我所做的所有格式化(使用标签,大多)。简报,我想能够发送SMTP邮件,而收件人只能以纯文本形式发送。
请告诉我们您做得更准确:
*你发送了信息吗?作为使用电子邮件包的附件?
*你是否为身体创建了替代文本和HTML部分?
我从未设法发送纯文本邮件并以HTML格式接收。
也许你的意思是某些智能客户做了一些愚蠢的事情
你的文字,例如。它会删除你邮件中的换行符吗?
试试这个:
导入smtplib
def send (server,from_whom,to_whom_list):
smtp = smtplib.SMTP(服务器)
smtp.sendmail(from_whom,to_whom_list,
" "" From:%s
To:%s
主题:测试电子邮件
这是一个测试。
它有换行符。
是否有三个单独的行?""")
我试了一下as
发送(''localhost'',''t*** @ sil-tec.gr'',[''t***@sil-tec.gr' '])
我没有问题。你怎么了(替代其他服务器和
电子邮件地址,显然:)?
-
TZOTZIOY,我说英格兰最好。
亲爱的保罗,
请停止向我们发送垃圾邮件。
哥林多人
2005年6月27日15:38:59 -0700,谣言说Inkiniteo
< ga **** @ gmail.com>可能写得:
大家好。我有一个通过电子邮件发送信息的脚本,但我想通过电子邮件客户端或Gmail避免转换为HTML,因为它会破坏我所做的所有格式化(使用标签,大多)。简报,我想能够发送SMTP邮件,而收件人只能以纯文本形式发送。
请告诉我们您做得更准确:
*你发送了信息吗?作为使用电子邮件包的附件?
*你是否为身体创建了替代文本和HTML部分?
我从未设法发送纯文本邮件并以HTML格式接收。
也许你的意思是某些智能客户做了一些愚蠢的事情
你的文字,例如。它会删除你邮件中的换行符吗?
试试这个:
导入smtplib
def send (server,from_whom,to_whom_list):
smtp = smtplib.SMTP(服务器)
smtp.sendmail(from_whom,to_whom_list,
" "" From:%s
To:%s
主题:测试电子邮件
这是一个测试。
它有换行符。
是否有三个单独的行?""%(from_whom,
"," ; .join(to_whom_list))
我试过它了
send(''localhost'',''t *** @ sil-tec.gr'',[''t***@sil-tec.gr'']
我没有问题。你怎么了(替换其他服务器和
电子邮件地址,显然:)?
-
TZOTZIOY,我说英格兰最好。
亲爱的保罗,
请停止向我们发送垃圾邮件。
哥林多人
Hi guys. I have a script that sends the info by email, but i''d like to
avoid the convertion to HTML by the email client or Gmail, because it
ruins all the formatting i did (with tabs, mostly). Briefing, i wanna
be able to send SMTP mail and the receiver only get it in plain text.
On 27 Jun 2005 15:38:59 -0700, Inkiniteo <ga****@gmail.com> wrote:Hi guys. I have a script that sends the info by email, but i''d like to
avoid the convertion to HTML by the email client or Gmail, because it
ruins all the formatting i did (with tabs, mostly). Briefing, i wanna
be able to send SMTP mail and the receiver only get it in plain text.
Can you give a short example of how you are building the email ?
On 27 Jun 2005 15:38:59 -0700, rumours say that "Inkiniteo"
<ga****@gmail.com> might have written:
Hi guys. I have a script that sends the info by email, but i''d like to
avoid the convertion to HTML by the email client or Gmail, because it
ruins all the formatting i did (with tabs, mostly). Briefing, i wanna
be able to send SMTP mail and the receiver only get it in plain text.
Please tell us what you do more precisely:
* do you send the "info" as an attachment using the email package?
* do you create alternative text and HTML parts for the body?
I have never managed to send plain text email and receive it as HTML.
Perhaps you mean that some "smart" client does something stupid with
your text, eg. it removes line-breaks you have in your message?
Try this:
import smtplib
def send(server, from_whom, to_whom_list):
smtp = smtplib.SMTP(server)
smtp.sendmail(from_whom, to_whom_list,
"""From: %s
To: %s
Subject: test email
This is a test.
It has line breaks.
Does it come as three separate lines?""")
I tried it as
send(''localhost'', ''t***@sil-tec.gr'', [''t***@sil-tec.gr''])
and I had no problem. What happens for you (substitute other server and
email addresses, obviously :) ?
--
TZOTZIOY, I speak England very best.
"Dear Paul,
please stop spamming us."
The Corinthians
On 27 Jun 2005 15:38:59 -0700, rumours say that "Inkiniteo"
<ga****@gmail.com> might have written:
Hi guys. I have a script that sends the info by email, but i''d like to
avoid the convertion to HTML by the email client or Gmail, because it
ruins all the formatting i did (with tabs, mostly). Briefing, i wanna
be able to send SMTP mail and the receiver only get it in plain text.
Please tell us what you do more precisely:
* do you send the "info" as an attachment using the email package?
* do you create alternative text and HTML parts for the body?
I have never managed to send plain text email and receive it as HTML.
Perhaps you mean that some "smart" client does something stupid with
your text, eg. it removes line-breaks you have in your message?
Try this:
import smtplib
def send(server, from_whom, to_whom_list):
smtp = smtplib.SMTP(server)
smtp.sendmail(from_whom, to_whom_list,
"""From: %s
To: %s
Subject: test email
This is a test.
It has line breaks.
Does it come as three separate lines?""" % (from_whom,
", ".join(to_whom_list))
I tried it as
send(''localhost'', ''t***@sil-tec.gr'', [''t***@sil-tec.gr''])
and I had no problem. What happens for you (substitute other server and
email addresses, obviously :) ?
--
TZOTZIOY, I speak England very best.
"Dear Paul,
please stop spamming us."
The Corinthians
这篇关于纯文本邮件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!