I have been able to send mails from my own domain successfully. My problem now is that I need to access the account and retrieve all the mails that I receive from postmaster and process the information in the mail.
How can I do this? I have been searching the web but could only find solutions involving third party libraries. .NET doesn't bring an inbuild class that helps with this?
First you need to understand what protocols does the Mail Server in question support.
You can find this by either reading the help that accompanies it or search in Google for that Mail Server. You may also need to set some settings on the server before you can start coding.
After you understood what protocols your server supports, use some of the following:
If you are using a POP3 server, you may fine the following article useful : A POP3 Client in C# .NET
If you are facing IMAP or Exchange server, you may want to the link that Billy Coover gave you: Read MS Exchange email in C#
What type of email server are you working with? If it's exchange, there are some options: Access exchange e-mail in C#
First you can try to dedect what protocols(IMAP/POP3) supported by remote server.
You can try imap_clinet_app.zip or pop3_client_app.zip applications from http://www.lumisoft.ee/lsWWW/download/downloads/Examples/ to connect your server.
If you can connect, then specified protocol supported.
Both application comes with full source code, so if can use IMAP or POP3, you can use that library in your project.
Related
I am trying to create a web service using C#/.Net that can remotely access any user's lotus notes mailbox, contacts, etc. That is given the sever address and username/password details I want to send mails, create contacts, etc. Much like what one might do with EWS managed API for exchange accounts. I am currently using interop.domino.dll for this. It hasn't worked for me so far.
var session = new NotesSession();
session.InitializeUsingNotesUserName("username", "password");
var db = session.GetDatabase( "server", "xyz.nsf", false );
throws exception saying "user is not a server" or
"Failed to read server configuration"
I am a total lotus newbie and any help would be appreciated.
You mixed the server and client way to access the NotesSession. You have two choices:
Client Way
session.Initialize("password"); or session.Initialize();
Install a Notes Client and use Initialize(). If the client is started you do not need to provide a password. If the client is not started a password query will appear. The client is using the configured notes.id and needs that password. You could create a superuser id, that is capable to access all mail file and you do the authentication on your own. Initialize (NotesSession - LotusScript®)
This also should work on a server, but never tried this.
Server Way
session.InitializeUsingNotesUserName("username", "password");
I never tried this, but mistakenly used the method, so I know it's an error to use it with a client.
Theoretically: You Install a Domino Server and use the username and http-password of a user to identify as this user. I don't know if the dll find the right installation if you mix Notes Client and Server on on computer. Theoretically this could be controlled by the path variable, which executables the dll can reach via path. InitializeUsingNotesUserName (NotesSession - LotusScript®)
Domino Server on Windows Client: You can install a Domino Server on a Windows Client for testing purposes, the server will have limited network connections, because of the windows client, but it's utilizable for development. Bear in mind the EULA for Microsoft and IBM.
interop.domino.dll is not in focus of IBM any more. So think about what Richard Schwartz said and focus on the existing REST API or write your own web services as Notes Database and access it from C# as web service.
i try to connect with c# ( not by https ) to my Exchange Server(2010 etc.).
Problem is, some Users doesn´t start Outlook so they get no Notify
if is a new Mail is incoming.
So i want to Code some c# App, that is connecting with User Params.
and return the Message of of Unread eMails in a notifyIcon.
Does somebody know the best way to do this connection with Exchange?
grettings from germany
Frank
You can use the EWS-Api (Exchange Web Services). NuGet has it with this name.
With the API you can probably use AutoDiscover to get a connection to your Exchange and then read and write data as required.
We have used Independentsoft WebDAV .NET for Exchange to solve this. I costs some money, but it will save you a lot of time!
We have application implemented in WinForm. Now Customer requests to add new feature - Mail Function. That one i have to connect to customer mail server (Exchange Server) to send marketing email. They are using RPC Over HTTPS with Outlook Client to connect to Exchange Server. They asked me to refer this link http://www.msexchange.org/tutorials/outlookrpchttp.html
That all I know. When they asked, I even don't know what is RPC Over HTTPS. But after I did searching on Internet I understand a bit now. I really need a code sample for this problem.
Please advise me.
Thank you all a lot.
Regards,
What are you using to send messages now?
If you are using the Outlook Object Model or Extended MAPI to send using an existing Outlook profile, there is nothing you need to do - that will all happen under the hood.
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.
I have searched all over the web for a solution for this situation.
I created an application using a PowerTCP component to receive and change mails(Imap/pop3)
I created a new object for them and now all I want is to create a server*(Mail Server)* that uses Imap or pop3 mails to receive and sends mails with SMTP.
I know that I need to use specific ports for it.
What I want to know is how can I create an imap/pop3 object from my C# object(my class , properties, ext) using c# to send to the client email application (like outlook). I searched a lot for this and found nothing.
I don't want to use any "close" server application for this because that I want to change
Do I need to create it from the beginning or there is any ready to use solution for this.
do you have any suggestion code template ext...
TIA
Michal
Check out this site, it has examples of how to implement SMTP/POP
http://www.codeproject.com/KB/IP/Pop3MailClient.aspx
C#'s built in classes are pretty stable, use SMTP and POP3.
Good luck!
I believe S22.Imap is the most popular general IMAP protocol API in Nuget.