views:

438

answers:

3

Hello, Every body.
I want to use/have an application that works like a mail box or better to say mail server, I mean I want to have a simple page that is linked to an exchange server in background, receives the needed information like sender, destination, subject, text message and finally the attachment, and then a send button that sends the mail to the destination by click (off course using the specified exchange server).

Any help would be appreciated

+1  A: 
Shoban
thank you so much dear friend,but i want to use this sample application as a pop3 mail server,does your given solution need any additional code or ...??thank you again
What I have shown above is a sample code to connect to a server and send email. This cannot act as pop3 server. Your question asked for a code to send email.
Shoban
This code shows how to implement smtp and pop3 clients using c# http://www.csharphelp.com/archives2/archive449.html
Shoban
A: 

Does it need to use MAPI or can it just use SMTP? If it is the former, good luck. No good components out there that I am aware of. If it is the latter, then you can just use the normal System.Net.Mail libraries. A finaly option, if you are on Exchange 2007 is to use the web services API, but I'm not familiar with it enough to know if you can actually send mail through it.

Wyatt Barnett
A: 
    Imports System.Net.Mail

    Public Sub SendMail()
         Dim msg As New MailMessage("[email protected]", "[email protected]", "Your Subject Line", "The body of the message")
         Dim client = New SmtpClient("SERVERNAME")
         client.Send(msg)
    End Sub
Andrew Lewis