Sync sent mail with Sent folder - c#

I need to sync sent mails with the sent folders of mail servers, for the users to see at future moments. I can send mails using all these 3 ways, SMTP, CDO and Microsoft Outlook Object(MOO); out of which I can only see my sent mails with MOO. Now the problem is, Not all clients are using outlook, and thus its more impractical to use this.
Out of exercise, I had also used MAPI to send mails, but that don't send HTML body. Also I looked over this topic Microsoft Sent folder, but that don't solve my problem.
So is there anyway, I can send mail with HTML body and sync the sent mail with Sent Folder. ?
Thanks.

You can do that with Extended MAPI (C++ or Delphi), but you probably mean Simple MAPI.
If you are connecting to an Exchange mailbox, EWS is another option.

Related

How to read outgoing/sent emails from mailbox?

Is there any method in .NET to read the outgoing/sent messages from a mailbox?
I've accessed the received messages through Pop3.NET library, but I don't get how to access the sent messages.
Thanks
If the mail server supports the IMAP protocol, you can use a library such as MailKit to access the "Sent" folder, but whether the message(s) you expect to be there are there or not will all depend on whether the client that sent the message(s) also appended them (via IMAP or otherwise) to the "Sent" foolder.
FOr example, if you are sending mail using System.Net.Mail.SmtpClient, then any message(s) you send with that API will NOT end up in the account's "Sent" folder unless you explicitly append the message to that folder using a library such as MailKit to do it.

c# MailKit - Read receipt

Does anybody know if MailKit supports a read receipt (reply message on read)? I have not found anything on the web or on Stackoverflow.
Read receipts (i.e. automated messages being sent when a user opens a message) is not something that MailKit can do automatically, it must be implemented by the software using MailKit or by the mail server.
This feature is something that generally only groupware suites like Microsoft Exchange, Lotus Notes, and Novell Groupwise implement.
It is a feature that can be implemented by the mail server or by the mail client, but it is not a feature of any of the mail protocols and so MailKit does not implement it.
If you would like to support sending read receipts, you will need to automatically create a MimeMessage with a MessageDispositionNotification body part and send it when the user opens/reads a message in your client program.
To request a read receipt for a MimeMessage, you will need to set the Disposition-Notification-To header field like this:
message.Headers[HeaderId.DispositionNotificationTo] = "me#example.com";
If the receiving user agent supports read receipts and it is configured to send them, then you will theoretically receive one when the user reads the message.
For more information about read receipts, see rfc3798.

how to know the different status of sended email in c#

I am Creating an application in c# . I have to know how can I know the status of the sended email.The status May be.
4. Track sent emails to determine if they were:
4.1 delivered
4.2 opened
4.3 recipient opt-out
4.4 bounced (with the reason for the bounce)
4.5 time/date sent
4.6 which links in the email were clicked (and time/date they were clicked)
4.7 IP address, if user clicked any links in the email
Should I use Any API or Dll or something else.Please help .Any Help will be Appreciated.
If you program your application to send mail through a hosted SMTP server like http://www.sendgrid.com or http://www.ultrasmtp.com, you can access the delivery status of messages that you've sent.
There is no easy way to do what you want. Actually this status can be tracked by your SMTP server itself and if you are using some third-party SMTP server like GMail or any corporate server, I 'm afraid they won't give you access to those information without using a authenticated client.
From your C# program, if the SmtpClient.Send() method returns true, you can assume the mail has been delivered to the SMTP server. If in case, the delivary fails, you should receive a mail to the outbound mail ID's inbox. If you want to make outbound mails appear in your outbox, you should configure IMAP/POP3 configurations accordingly.
There is no API or DLL available in exact form you want, as far as I know. You can try some other way like tracking a hash or embedded image in the mail-body from your server. But these are not reliable way as most mordern Messaging services have counter-measures for this.

Check mailflow for Microsoft SMTP service

We have a SMTP Cluster (Microsoft SMTP Service) that we would like to check for mailflow every 5 minutes.
What we would like is to send a mail every 5 minutes through every node to a mailbox - check the mailbox for received mails and see how long it took.
We would like to use Powershell to do the sendmail function and we got that in place.
Our obstacle is how to read mails automatically? We have tested that we could use Gmail as receiving mailbox and can read mails through Powershell (Feeds / Atom) but that doesn't mark the mails as read in the mailbox.
We have own Hosted Exchange, maybe we could use that for receiving mail?
Any thoughts?
Best regards
If you have Exchange mailboxes available, you can script reading and manipulating email (including marking as Read) with Powershell using the EWS managed api:
http://msdn.microsoft.com/en-us/library/dd633710(v=EXCHG.80).aspx
Glen Scales has many good articles and code samples for using it on his blog:
http://msdn.microsoft.com/en-us/library/dd633710(v=EXCHG.80).aspx

how to create a SMTP server

I have an application that run on server,
I want that my application could received mail in order to start some function.
I would like to know what should I need to do in order to have this capability?
Do I need to build SMTP server? if so, how should I do it?
You can try: http://www.lumisoft.ee/lsWWW/download/downloads/ .
There is SMTP server component what you can use to recieve emails.
Or alternatively there is SMTP server written in C#, you can write message filter for server.
In filter you can access incoming message and do what ever you want with it.
--- Yes also as others suggested will work ok too, you just run simple mail server and get emails by pop3 or imap. Pop3 and Imap components and example applications also included in same link.
You can use IIS6 to receive email and drop it into a specified folder. Your app can then pick up those emails and do whatever it needs to with them.
Active the SMTP service in IIS. It drops emails in the C:\inetpub\smtproot\drop folder IIRC.
Then you just need a Mime parser to read the EML files. I used the one in Lumisoft when I did the same thing.
You could use any Mailserver to receive the mail and have your application check the poxtbox every 1 minute to receive the mails.
When any mail arrived (or special subject as you need), you could execute your code.
For IMAP you could look at this Library
I have previously had some success using the Chilkat POP3 component to programmatically monitor a POP3 account for incoming mail.

Categories

Resources