[英]How to add multiple e-mail recipients in a mail , but send the mail to only a selected few addresses?
I am building an app for journaling purpose , were I will put all messages in an e-mail and will send it to a journaling mailbox . 我正在构建一个用于日记目的的应用程序,因为我会将所有消息都放入电子邮件中并将其发送到日记邮箱。 What I want is to display the email addresses of all the recepients of original messages in to field but not actually send them any mail.
我想要的是在字段中显示原始邮件的所有收件人的电子邮件地址,但实际上不向他们发送任何邮件。 For example if a message was sent to "abc@domain.com" then on journaling I want to display "abc@domain.com " in to field of journaling mail but not actually send this mail to "abc@domain.com" I am coding this application in c#, is there any way to achieve this?
例如,如果一条消息发送到“ abc@domain.com”,那么在日记中,我想在日记邮件的字段中显示“ abc@domain.com”,但实际上并未将此邮件发送到“ abc@domain.com”我正在用C#编码此应用程序,有什么方法可以实现?
Here is a sample of SMTP commands (from Wikipedia ) that are used when sending a mail: 这是发送邮件时使用的SMTP命令示例(来自Wikipedia ):
HELO relay.example.org
MAIL FROM:<bob@example.org>
RCPT TO:<alice@example.com>
RCPT TO:<theboss@example.com>
DATA
From: "Bob Example" <bob@example.org>
To: Alice Example <alice@example.com>, John Example <john@example.com>, Jane Example <jane@example.com>
Cc: theboss@example.com
Date: Tue, 15 January 2008 16:02:43 -0500
Subject: Test message
My Test message.
.
QUIT
The real recipients of this email are specified by the command RCPT TO
. 此电子邮件的实际收件人由命令
RCPT TO
指定。 Then in the DATA
command, which contains the content of your mail and some headers such as From
, To
, Subject
,... You can specify whatever you want in those headers (including From
and To
). 然后在
DATA
命令中,该命令包含邮件的内容以及一些标头,例如From
, To
, Subject
,...。您可以在这些标头中指定所需的内容(包括From
和To
)。
So you put all the original recipients in the To
header. 因此,您将所有原始收件人放在“
To
标头中。 And you add only your journaling mailbox with the RCPT TO
command. 并且您仅使用
RCPT TO
命令添加RCPT TO
邮箱。 This will send the mail only to your journaling mail box, but all the recipients will be displayed in the To
header of the mail when you open it. 这将仅将邮件发送到日记邮箱,但是当您打开邮件时,所有收件人将显示在邮件的“
To
标题中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.