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?
Asked
Active
Viewed 1.1k times
1
-
You might be able to edit the mail after sending to add addresses to the "To" - havent tried it, but this sounds like a bad idea. – BugFinder May 22 '17 at 08:52
1 Answers
3
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.

Arnaud Develay
- 3,920
- 2
- 15
- 27
-
-
You have to implement your own SMTP client since the one delivered with the framework do not allow to customize the `To` header. I have done it in my previous job, it is not so difficult. – Arnaud Develay May 22 '17 at 11:07
-
I think my problem will be resolved by implementing custom smtp protocol only . Thanks for advise – vidit mathur May 31 '17 at 09:28