.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Get email from Exchange server in C#?

Posted By:      Posted Date: October 14, 2010    Points: 0   Category :ASP.Net

Hi all,

If I've understood right there is no built in functionality in an version of .NET för checking email on an Exchange server, is that correct?
If that is correct, does anyone know of any (free) component to use for this?

What I want to achieve is to have an application that checks the email on an Exchange server and the performs different actions, depending on the content of the email.


View Complete Post

More Related Resource Links

C# , Sending email through exchange server?

I've searched on this and tried several methods using System.Net.Mail but I can't get it to work. I want to send email using the Exchange server they have at work. Anyone could show me how to do this (server requires authentication)   Thanks in advance

SQL Server Tables and Exchange Web Services sample does not include email body

I've sucessfuly implemented the above, very useful example. However, I cannot work out how to include the Body of the email with the reast of the data. Can anyone shed some light for me? Thanks Robert

Send Email from SQL Server Express Using a CLR Stored Procedure

One of the nice things about SQL Server is the ability to send email using T-SQL. The downside is that this functionality does not exist in SQL Server Express. In this tip I will show you how to build a basic CLR stored procedure to send email messages from SQL Server Express, although this same technique could be used for any version of SQL Server.

If you have not yet built a CLR stored procedure, please refer to this tip for what needs to be done for the initial setup.

send email using Godaddy server by gmail


 Hello ,


My site is hosted  in Godaddy server. And i am using google apps for emailing a/c for that i have changed the  MX-records and then it is working fine.

Then i finished my web site


it is working fine there .

in the site there is a  contactus link which opens


this page basically should send a mail to a particular email id .

for sending mail I am using gmail a/c . (Here is the full code)


public void SendEmail(string From,string GmailEmail, string GmailPassword, string To, string Subject, string Body,      
        FileUpload fileupload)

        System.Net.Mail.MailMessage mail = new System.Net.Mail.MailMessage();
        mail.From = new MailAddress(From, "One Ghost", System.Text.Encoding.UTF8);
        mail.Subject = Subject;
        mail.SubjectEncoding = System.Text.Encoding.UTF8;

Sending Email by exeucting a stored proc on SQL Server that references CLR

Hi Guys, I want to modify the data type of the @body variable in the stored procedure that sends an email. The stored procedure is as follows:   CREATE PROCEDURE [dbo].[spSendMail4]<br/> @recipients [nvarchar](4000),<br/> @cc [nvarchar](4000),<br/> @subject [nvarchar](4000),<br/> @from [nvarchar](4000), @body [nvarchar](4000), @attachment [nvarchar](4000)<br/> WITH EXECUTE AS CALLER<br/> AS <br/> EXTERNAL NAME [SMTPCLR].[StoredProcedure].[spSendMail]<br/> GO   I want to change the @body variable to data type: text. The reason for this, is because I am sending an HTML email whose content (characters) exceed 8000. Basically the new stored procedure should looks like below:   CREATE PROCEDURE [dbo].[spSendMail4] @recipients [nvarchar](4000), @cc [nvarchar](4000), @subject [nvarchar](4000), @from [nvarchar](4000), @body text, @attachment [nvarchar](4000) WITH EXECUTE AS CALLER AS EXTERNAL NAME [SMTPCLR].[StoredProcedure].[spSendMail] GO   If attempt to make this change, I get the below error:   CREATE PROCEDURE for "spSendMail" failed because T-SQL and CLR types for parameter "@body" do not match.   Understandably so, because from the article http://msdn.microsoft.com/en-us/library/ms131092%28SQL.100%29.aspx CLR data type (.NET Framework) is not compa

Moss 2007 integration with Exchange Server.

Hi All , I am planning to Use exchange server for sending and receiving emails via Sharepoint. can you guys provide me with links or material that can guide me as how i can achieve it Cheers, Friend.

Connection to Exchange Server of .NET 1.1 Framework application on Windows 2008 64-bit

I am running Visual Studio 2003 .NET Framework 1.1 application on Windows 2008 64-bit machine. There is only one problem - connection to Exchange Server. The same application is running fine on Windows 7 64-bit machine (not server). I tried to use the same Interop.MAPI.dll I used for Windows 7, but it doesn't work for Windows 2008.   Please help.  

Exchange Server 2007 SP1 mailbox migration into 2010

Hi Everyone, I’ve got all in one Exchange Server 2007 SP1 RU3 that got all in one role installed (HT-CAS-MBx) in Windows Server 2003 Standard R2 SP which is also running as domain controller with all FSMO role. I’m planning to migrate the Exchange Server 2007 server role into the Exchange Server 2010 Standard that I have prepared in my Virtual Machine of Windows Server 2008 R2, what is the safest migration path to make the email flow working end to end parallel (staging migration process). [B](please also not that this Exchange Server 2007 SP1 got so many problem like – OOF email error in Outlook 2007, meeting scheduler stopped working, etc… therefore updating it into SP3 is not the way here and I've backed up the mailbox using Backup Exec 2010 in case i can just restore the backed up mailbox into the new server 2010 if possible)[/B] My this is what I’m about to do: 1. Transfer all FSMO role into another domain controllers 2. Install and configure similar role in the new VM (Exchange Server 2010 Std.) 3. Confused… Things to do after all mailbox migration: 1. Cutover the MX record into the new server name 2. Install updated UCC- SSL certificate into the exchange server 2007 Any kind of help and suggestion would be greatly appreciated. Thanks, AWT /* Infrastructure Support Engineer */

Trying to email through SMTP on server 2008

I have the following form and trying to click a button and email through an SMTP server. Any suggestions? Thanks.<table class="style1" bgcolor="#003366" cellpadding="3" cellspacing="3"> <tr> <td class="style2"> Your name:<br /> <asp:TextBox ID="txtHDName" runat="server" Width="161px"></asp:TextBox> <br /></td> </tr> <tr> <td class="style2"> Your email:<br /> <asp:TextBox ID="txtEmail" runat="server" Width="161px"></asp:TextBox></td> </tr> <tr> <td class="style2"> PC name:<br /> <asp:DropDownList ID="DropDownList1" runat="server"> </asp:DropDownList> </td> </tr> <tr> <td class="style2"> Problem:<br /> <asp:DropDownList ID="DropDownList2" runat="server" Width="128px"> </asp:DropDownList> &l

Sending an email with a link that verifies an id in sql server

I have an online job application program that the user fills out and submits the information to our database and on the last page they give there email address so that we can send them an email that has a link that is associated with the ID that's autogenerated by the sql server database when the user submits the information, when the link is clicked it verifies to the database to keep the information submitted by that user per their autogenerated ID. Below is the code that i've written to send the email I have the link setup to go to yahoo right now but I am not sure how to get this to send the autogenerated link that is associated with the ID that is autogenerated already in my sql server database.Private Sub SendMail()        Dim emailSender As SmtpClient        Dim theMessage As MailMessage        Dim EmailAddress As String = txtEmailAddress.Text        emailSender = New System.Net.Mail.SmtpClient("ppicom")        theMessage = New MailMessage        theMessage.From = New MailAddress("PeerlessProductsInc @mail.com")        theMessage.To.Add(EmailAddress)        theMessage.

windows server with sharepoint incoming email

Hi all... I need to configure incoming email in sharepoint but I didn't configure the smtp email in server2003 how can i confiure email without active directory , I need to use email to recieve email in sharepoint but sharepoint didn't connect to active directory , it connect to form authentication (users in sql DB) so please, what's steps? Thanks

Configure Incoming Email in SharePoint 2010 with a remote (public) SMTP Server

I have a standalone SharePoint 2010 Installation on my local network. Have configured the SMTP Services and a SMTP domain called "internalcompany.com". Created a hosts file entry also for that - now outlook is able to send emails to this domain; it reaches the drop folder and from there SharePoint picks it up and pushes to the document libraries. So far so good. But obviously this is not what I want to do: my www.company.com is my public domain and mail server is mail.company.com - how do I get the local SMTP point to this address - so that if someone sends an email to shareddocs@company.com (just like any other normal id), it comes to my local server and then SharePoint. How do I do this? Remember, my server is standalone and my network is not domain based and does not have exchange.Karthick

Can I upload email back to server

When I setup outlook to a re-formated computer at home. Outlook connected my personal email provider's server and automatically downloaded email, meanwhile removed all my email in the server!!! This is horrible function! I know that I should do advance setting and choose "leave email in sever" before finish. Dose anyone know that I can up load email back to server then I can access the email from other computer?   I really don't understand why Microsoft office has so many auto function, especially why I need to go to advance setting to avoid email delete!!!!!!!! Thanks,       

Email Problem with Exchange 2010

Good day,   I recently upgraded a server of mine with a simple ASP site to server 2008 and it sent emails from exchange 2003 with no problems after the upgrade to server 2008.  Here is the code: private void SendTextMessageCC(string fromAddress, string fromName, string toAddress, string subject, string body, string ccAddress) { try { MailAddress fromAdd = new MailAddress(fromAddress, fromName); MailAddress toAdd = new MailAddress(toAddress); MailAddress ccAdd = new MailAddress(ccAddress); MailMessage msg = new MailMessage(fromAdd, toAdd); msg.Subject = subject; msg.Body = body; msg.CC.Add(ccAdd); SmtpClient client = new SmtpClient("deexch1.****.com"); // localhost client.Send(msg); // msg.DeliveryNotificationOptions = 0; // 2 means OnFailure was 1 but that was error 0 okay means "None" } catch (SmtpException s) { lblSuccess.Text = s.Message; } } Now this week I upgraded my Exchange Server to 2010 and changed the smtpclient string accordingly above to SmtpClient("draw-mail1.****.com"). It will not send emails from the se

One-To-One Client Certificate Mapping in Exchange Server 2010 WCF Configuration

Hi.I am having a java client which has proxy classes generated with jax-ws to use the exchange web services (exchange server 2010). This proxy only supports SOAP11.What I need is to configure exchange servers with CAS role to (additionally to the default authentication) map one certificate to one windows accout. Until now I: imported the servers certificate and enabled it (import-ExchangeCertificate -fileData ([Byte[]]$(get-content -path <certpath> -encoding byte -readCount 0)) -password:<security-string pwd> | enable-ExchangeCertificate -services IIS) created a client certificate mapping in IIS 7 and here is where I got stuck What do I have to change in the "...\V14\ClientAccess\exchweb\ews\web.config" to get this scenario work?The web.config file looks like this: <services> <service behaviorConfiguration="EWSServiceBehavior" name="Microsoft.Exchange.Services.Wcf.EWSService"> <endpoint address="" binding="customBinding" bindingConfiguration="EWSHttpsBinding" contract="Microsoft.Exchange.Services.Wcf.IEWSContract"> <endpoint address="wssecurity" binding="customBinding" bindingConfiguration="EWSWSSecurityBinding" contract="Microsoft.Exchange.Services.Wcf.IEWSContract"

incoming email on WSS 3.0 in a standalone server environment


Hello Everyone, I have a windows SBS 2008 with exchange 2007 and WSS 3.0 2007 all on one server.

My problem is as follows, I have been trying to set up incoming email inside of wss 3.0, but every guide, blog, and wiki says I need to have SMTP installed, I however cannot have this installed with my configuration. I have created a exchange send connector, created a drop folder, and when I try to email a document to a document library, I get a failure in exchange as follows:

Diagnostic information for administrators:


Generating server: SCS01.scs.com

Mail Enable Sharepoint 3.0 with Exchange 2007 on same server.


Windows 2008 SBS with 2007 and Sharepoint 3.0.  I can create the email contact and it works fine but when I attempt to send the email with the attached document I get the following error and the email never makes it to the document library.

#554 5.4.4 SMTPSEND.DNS.MxLoopback; DNS records for this domain are configured in a loop ##

Can I get the STEP by STEP procedures to mail enable a Document Library on Sharepoint 3.0 with EXCHANGE 2007 on the same server or is there a simple fix that I can do to get this resolved.


PLEASE advise ASAP. I have been working on this issue off and one for weeks and the client really wants this for their timesheets.

Thanks in advance!

Mike Pratt

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend