简体   繁体   中英

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?

Here is a sample of SMTP commands (from Wikipedia ) that are used when sending a mail:

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 . 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 ).

So you put all the original recipients in the To header. And you add only your journaling mailbox with the RCPT TO command. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM