473,806 Members | 2,878 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sending an email to exchange group using c# windows service.

Hello All,

I am working on an service application to send an emails from exchange
server.

I want to use the groups created in the exchange server to send the
mail.

At present I am using the following code to send the emails

CDO.Message oMsg = new CDO.Message();
CDO.IConfigurat ion iConfg;
iConfg = oMsg.Configurat ion;
ADODB.Fields oFields;
oFields = iConfg.Fields;
ADODB.Field oField = oFields["http://schemas.microso ft.com/cdo/
configuration/sendusing"];
oField.Value = 2;
oFields.Update( );
oField = oFields["http://schemas.microso ft.com/cdo/
configuration/smtpserver"];
//Exchannge server
oField.Value = "xxx.xxx.co m";
oFields.Update( );

oField = oFields["http://schemas.microso ft.com/cdo/
configuration/smtpserverport"];
oField.Value = 25;
oFields.Update( );

oField = oFields["http://schemas.microso ft.com/cdo/
configuration/smtpaccountname "];
oField.Value = "xx*@xxxx.c om";
oFields.Update( );

oField = oFields["http://schemas.microso ft.com/cdo/
configuration/sendemailaddres s"];
oField.Value = "xx*@xxxx.c om";
oFields.Update( );

oField = oFields["http://schemas.microso ft.com/cdo/
configuration/smtpuserreplyem ailaddress"];
oField.Value = "xx*@xxxx.c om";
oFields.Update( );
oField = oFields["http://schemas.microso ft.com/cdo/
configuration/sendusername"];
//My domain and username
oField.Value = @"xxx\xxxx";
oFields.Update( );

oField = oFields["http://schemas.microso ft.com/cdo/
configuration/sendpassword"];
//my password
oField.Value = "xxxxx";
oFields.Update( );

oMsg.TextBody = "Hello, how are you doing?";
oMsg.From = "xx*@xxxx.c om";
oMsg.To = "xx*@xxxx.c om";
oMsg.Send();

I am successful when I send a mail to email account.

But there is an error when I refer a group.

Another problem I am facing is I want to see the mail in sent mails of
microsoft outlook. Can it be done?

Its very urgent please let me know.

Sachin

Apr 18 '07 #1
0 1607

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
4321
by: Sven Templin | last post by:
Hello all, our configuration is as following described: - OS: Windows 2000 - Apache server 1.3 - Php 3.8 - MS outlook client 2000 _and_ no SMTP server available in the whole intranet.
6
2910
by: Robert Pettersson | last post by:
Hi, I have built an webapp in C# that uses SMTPMail to send mail to users. When I installed it on the prodserver everything worked fine for me, but the users can not send mail. They get Access denied. If I add them to the administrator group of the server everything works fine. I have set <identity impersonate="true"/>
5
3183
by: Kevin Swanson | last post by:
First, apologies for cross-posting. I posted this message originally in exchange2000.development, but it looks like that's an unmanaged group. At least it doesn't show up in the list when looking at the managed groups... Here's the original post: I'm writing an ASP .net web application that (in part) adds a calendar item to the user's Exchange mailbox. I "stole" some code that many people seem to be using, and it works great as long as...
11
1869
by: tshad | last post by:
I have a W2003 server running my website and I am trying to set up my pages to send email using System.Web.Mail. I have pages running on this machine using CDONTS that work fine. I am using our exchange server to send the mail but am getting an "Unable to relay" message. But the "From" name is my email address, which is obviously on our exchange server, so there is no relay. The message I get back is:
8
4386
by: Frank | last post by:
I think I've confused myself completely here :-) I have used System.Web.Mail, but am not sure if this works with Exchange Server 5.5. I asked the client if they're email server supported SMTP, and got the following reply (exact quote): Exchange 5.5 uses IMS connector for communication between the internal and the external world. IMS is based on SMTP Protocol. For mail flow within the organization Exchange 5.5 uses Message Transfer...
9
3229
by: B-Dog | last post by:
I've built a small app that sends mail through our ISP's SMTP server but when I try to send through my local exchange server I get CDO error. Does webmail use SMTP or does it strictly rely on CDOmail. I don't want to use the Outlook reference because outlook prompts each time program access it and I have found a way to disable that. Can I use webmail with exchange? Thanks
1
8188
by: Eric Sheu | last post by:
Greetings, I have been searching the web like mad for a solution to my SMTP problem. I am using Windows Server 2003 and ASP.NET 2.0 w/ C# to send out e-mails from a web site I have created to the members of my organization. I think my problem is incorrectly setting the settings on my server or an authentication problem. Here is the code I have written to send a test message: -----Code Begins: Sensitive Information Replaced by -----...
8
2504
by: Mike Owen | last post by:
Hi, I am using the following code to send email on a Windows 2003 Web Server: Imports System.Net.Mail ........ Dim msgmail As New MailMessage msgmail.To.Add(New MailAddress(objMember.EmailAddress)) msgmail.From = New
0
2779
by: Sister Ray | last post by:
I'm trying to create a simple form that sends an email using my company's exchange server. I'm using the System.Net.Mail Namespace of the .net framework 2.0. I've googled everywhere and i think my code is ok, however i keep getting a "A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond" error every time. Any...
0
9719
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9597
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10618
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10371
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7649
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5678
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4329
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3850
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.