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.
Related
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.
I am working on an ASP.NET website. I have a page where I'm sending mail. Here the user adds the recipient; the sender is his own id. When I run this application on my location machine the mail properly comes in my inbox but as I paste that page on the server and try mailing the mail comes in Junk folder.
Can somebody please help me out?
Check if your Sever IP is added in Relay list of SMTP server.
This doesn't sound like it has anything to do with code and more about setting your SMTP servers up properly in the realm of DNS and/or discussing it with your hosting provider. According to your post, your ability to send mail is not the issue - its more about how the receiving agent treats your email (tags it according to some rule, etc.). The only difference being "who" sends the email (your local machine, vs your server).
There are Postmaster resources - this one from everyone's favorite- AOL that you may find useful. You can also check with DNS blacklists if your server's IP is (unfortunately) listed.
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.
We have a website sending mail alerts to end users. The site has been developed in c# ASP.NET.
I want to find the best way to send the email alerts to my users. Making sure the mail is not trapped in any spam filters. I read on the internet it is best to sent the mail directly from the web server and not route via an SMTP mail service such as google apps or Postini.
Can anyone tell me if this is correct?
First of all
Making sure the mail is not trapped in
any spam filters
Is not possible - otherwise spammers would do this. You just have to make sure you're domain isn't associated with any spamming activities and watch for keywords within the email.
I read on the internet it is best to
sent the mail directly from the web
server and not route via an SMTP mail
service such as google apps or
Postini.
This point doesn't make sense - your e-mail will never be delivered if it doesn't get routed via an SMTP server, the average message will pass through multiple on its route to the recipient.
The answer is to not actually send email and let someone else deal with the problem. I'd look at postmark or Amazon's simple email service.
We had problems that mails sent with local server often get trapped in spam filters until we implemented SPF on our mail server.
http://en.wikipedia.org/wiki/Sender_Policy_Framework
But I am not admin, that's just what our admin said, and after that we have no problems anymore.
btw. maybe would be better to ask on serverfault.com
As part of my app's config process, I have a sanity checker that validates all user-supplied data. This includes email server settings that the app uses to send email.
I'd like a simple sanity check on those settings without actually sending any email. It'd be great if this could support all standard flavors of SMTP setups including those with authentication/ssl/etc.
It doesn't need to be exhaustive but the more coverage, the better.
Currently all I do is verify I can open a connection to the given server on the given port. Something a little deeper would be nice.
Note: I'm not trying to validate email addresses--that's not relevant to this question.
You just open a raw connection to the server & port that the user supplies and do a
HELO Server.Domain.Com
Mail From: validaccount#domain.com
to see if you get a valid HELO response & Sender OK Response
(if smtp authentication is enabled).
Same as you would do if you telnet direct to the server.
http://www.petri.co.il/test_smtp_service.htm
This might also be useful
http://qmail.jms1.net/test-auth.shtml
I'm sure someone brighter and more qualified will pipe up with a better answer. However, at first blush I'd say that you cannot verify the ability to successfully send email without actually sending an email.
However, if you want to automate the process, you can have a 'MyApp_SanityCheck#gmail.com' (or your local domain) address.
Then you can create a watchdog application that monitors that email address, or just a simple app which programmatically interfaces with that email address and checks if an email was received within X minutes. This way you can be 100% certain that the emails are able to be sent out.
This link shows how to programmatically check gmail addresses.
An important note: If you application is sending out external emails, then it would be best if the email address you use is external, because it is possible that your server could be unable to send external emails, but internal emails go through just fine, and in that case your sanity check would send up a false positive.