如何将信息填充到电子邮件列中 [英] How to pad information into columns for email

查看:120
本文介绍了如何将信息填充到电子邮件列中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过Gmail的具有SMTP功能的Oracle数据库发送电子邮件.

I am trying send a email from an Oracle database with an SMTP function with Gmail.

信息是通过数据库中的查询选择的,因此,对于每一列,我都用RPAD设置空间.我用以下结构制作消息:

The information is selected with a query in the database, so, for each column I set the space with RPAD. I make the message with this structure:

l_mailtext := l_mailtext || CHR(9) || LPAD(L_NUMBER, 6, '0') || CHR(9) ||
                  CHR(9) || CHR(9) || '  ' || I.CONTRACT_REF_NO || CHR(9) ||
                  RPAD(I.SPEI_TRACE_NO, 40, ' ') ||
                  RPAD(I.REMARKS, 30, CHR(32)) || 
                  rpad(I.ACTUAL_AMOUNT, 30, ' ') || 
                  rpad(I.PC_STATUS, 30, ' ') || CHR(10);

在执行此过程时,我检查了已发送的邮件,信息显示如下;这是通过Google Chrome浏览器中的Gmail.

Doing the process, I checked the mail sent and the information shows the following; this is via Gmail in Google Chrome.

我将相同的信息复制并粘贴到Notepad ++工作表中,并向我显示正确的布局:

I copy and paste the same information in a Notepad++ sheet and it shows me the correct layout:

.

因此,我需要信息类似于Gmail中的记事本++.我不知道是否有用于填充信息的ASCII字符.因为"Gmail邮件中的付款方式"列中的金额"列中的信息会混乱.

So, I need the information looks like Notepad ++ in Gmail. I do not know if there is a ASCIIcharacter for padding information. Because information in "Amount" column disorganizes by Payment concept Column in Gmail message.

推荐答案

您的数据已正确填充.您已经在NP ++中证明了这一点. Gmail会以比例字体显示您的电子邮件正文,其中每个字符的宽度都不同.我认为,您有两个选择:

Your data is padded correctly. You've demonstrated that in NP++. Gmail is displaying your email body in a proportional font, where each character is a different width. I figure, you have two options:

  1. 发送标题为Content-type: text/html的电子邮件,并使正文成为HTML(我认为,您可以这样做).您可以在内容周围包裹<pre>标记,这告诉用户代理以固定宽度的字体呈现它,并保留间距.

  1. Send the email with a header of Content-type: text/html and make the body HTML (I think you can do this). You could probably wrap <pre> tags around your content, which tells the user agent to render it in a fixed-width font with spacing preserved.

您可以将内容发送为.txt附件,该附件可能会以Notepad ++之类的格式打开,并以固定宽度的字体显示.如果他们将.txt附件设置为在Wordpad中打开,那将不是真的.

You could send your content in a .txt attachment, which would likely open up in something like Notepad++, where it would be in a fixed-width font. If they have .txt attachments set to open in Wordpad, that won't be true.

请注意,这实际上与Gmail无关.这与收件人使用的邮件客户端以及您如何标识内容有关.今天,可能是Gmail,明天,他们可能会切换到Outlook或Thunderbird.

Note that this doesn't really have to do with Gmail. This has to do with the mail client your recipient is using and how you are identifying your content. Today, it may be Gmail, tomorrow, they might switch to Outlook or Thunderbird.

这篇关于如何将信息填充到电子邮件列中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆