I have implemented IMAP Idle client using this example.
https://github.com/jstedfast/MailKit/blob/master/Documentation/Examples/ImapIdleExample.cs
I have millions of emails. I am saving message ids of emails as I am reading them.
In an event where computer/server hosting code is shutdown or restarted.
Is it possible to start reading emails after specific message id.
I do not want re fetch all emails which are already read by code.
Instead of saving the MimeMessage.MessageId, why not just save which UniqueId's your program has seen? They don't change between session and they are sequentially ordered.
This is how every IMAP mail client in the world avoids re-downloading the same messages over and over.
Related
I want to make windows based Whats App bulk messages sender application.
I tried WhatsApi (http://github.com/perezdidac/WhatsAPINet/) to do that, but I found too many limitations and problems.
I want to ask that, I there another way to send bulk whats app messages?
Sending bulk messages are against WhatsApps Terms of Service Agreement. WhatsApp offers users functionality to send broadcast messages, but with a maximum of recipients AND recipients will only receive your message if they have already saved your number in their contact list.
WhatsApp's Terms of Service Agreement states that you may not use the service to send bulk messages (in other words more messages than a normal person would be able to send during a specific time). This keeps their servers from being overwhelmed and keeps advertisers from abusing WhatsApp messages. You can, however, try to write a function to select x number of contacts and send the message, then repeat the function until all intended recipients have been messaged.
BACKGROUND
First time using Pop3.
Using OpenPop library.
Have configured Gmail to work with Pop3.
PROBLEM
Have been debugging code to see what happens (and try to get body text). Messages downloaded first 2 or 3 times.. got the UIDs with this:
var uids = client.GetMessageUids();
This time, it is no longer fetching any UIDs and I can't figure out why. Note, I did prematurely terminate the app a couple of times. My Gmail settings are configured to keep the mails on the server even after downloading them with a pop client. I even tried setting some mails to unread status in the hope that would work, but it doesn't.
So, any ideas what would cause this method to stop working after 2 or 3 goes? Does Gmail have some kind of security issue or maybe know that this client has acquired the messages already and doesn't send the messages anymore or what?
EDIT
I sent an email to that address and now it does show 1 message. So what I really need to know is HOW does the client (or Gmail) know which messages have been downloaded or not? This is very important, because if an error occurs and I cannot store the email for my app, the next time a refresh is done, the message will not be downloaded again and so messages will be missing from the application. Is there a way to reset it? Where is this being recorded?
OpenPop does not store anything about messages by itself. It simply fetches whatever you tell it to. Gmail is a strange POP3 provider, as seen in What non-standard behaviour features does Gmail exhibit, when it is programmatically used as a POP3 server?
Gmail does not present the same message if it has been downloaded by any POP3 client. You could use the recent:username login method to see the last 30 days worth of email always.
We have a Windows Service to check if certain conditions are met, we will send an email to the customer. We will have about 50 emails to send everyday. My question is, is it better to send emails out individually (i.e. every time the condition is met, triggers sendmail function) or queue all the emails and send in a batch? Is it better to send in a batch because of performance reasons? But we only send about 50 emails a day so it doesn't matter too much? How would you queue the emails if the emails should be send in a batch?
Many Thanks
Generally the reason for batching multiple e-mails into a single e-mail is so as not to irritate the recipient, rather than for performance reasons. 50 e-mails throughout the day can be very annoying and will quickly cause the recipient to "tune out," whereas a single e-mail containing all pertinent notifications may be easier to digest.
As to how to re-queue the e-mails, it would be best if you could modify the service itself to store the outgoing e-mails in a file or buffer and only send the contents of that file or buffer once a certain threshold has been reached - be that a time threshold or a size threshold.
If you're only sending 50 emails a day, the point is entirely moot.
In terms of the actual server, SMTP doesnt care if you send in batch or individually, it is just working through an email backlog queue to send out.
The only real concern should be if you need to continously query your DB for emails to send, or if you want to query your DB for batches of email to send (to cut down on DB queries).
Ignoring performance, there's another thing you need to keep in mind: does the user need that e-mail as soon as the condition is met? If so, don't even consider queueing the messages unless you're emptying the queue on a nearly constant basis.
Otherwise, it's really up to you. 50 e-mails a day isn't going to break your server, so I wouldn't worry about performance. On the other hand, if it's convenient for you and your users to send the e-mails in batches, go for it.
I am looking into a way to more securely send emails from our application.
We are currently sending emails directly to an IIS SMTP server but are looking at ways to more securely deliver emails if the server goes down, restarts etc.
I was thinking a way to implement this would be to store the emails (with attachments) in a queue to be process by a separate process, or store the emails in the database to be then processed.
I was wanting to get some advice and any suggestions would be appreciated.
Thanks
We have a likewise case. We solved it by storing the emails in a database that keeps fault and retry status. We're using FreeSMTP to send the actual messages. Quicksoft also has a all-out product that handles errors itself and keeps its own message database if that is what you're looking for (not so free though ;-))
I have a job that runs which sends out emails to our users to which starts off a work flow process in our company. Periodically, a user will swear up and down that they didn't receive the email - though, when we go to the mail administrator to pull an exchange report, 10 times out of 10 it's in their deleted items. :P
I'd like to be able to programmatically verify that messages sent via .net C# (System.Net.Mail I think) reached the user's mail box.
It's exchange 2007 and all messages are internal.
You can't with System.Net.Mail. You'll have to dig through Exchange's APIs to determine if an email is present in someone's email account.
http://support.microsoft.com/kb/813349
Set an account for catching all bounce backs. In this way you will know which ones reached and which ones did not. This is the best way to ensure emails reached.
Alternatively you can add read reciepts via message headers(by setting the Disposition-Notification-To). but again, user can chose not to read it...
I see two ways to do what you want:
Send emails with "delivery confirmation" On (not "read receipt", this can be dismissed by the user as CoddeToGlory said). Then it's jut a matter of monitoring the mailbox that receives these confirmations via any way it's appropiate to you: Exchange Web Services, Outlook+COM or VBA, MAPI, ...
Use the powershell interface to Exchange and capture the output of Get-MessageTrackingLog looking for StoreDriver + Deliver events.