473,407 Members | 2,320 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

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.IConfiguration iConfg;
iConfg = oMsg.Configuration;
ADODB.Fields oFields;
oFields = iConfg.Fields;
ADODB.Field oField = oFields["http://schemas.microsoft.com/cdo/
configuration/sendusing"];
oField.Value = 2;
oFields.Update();
oField = oFields["http://schemas.microsoft.com/cdo/
configuration/smtpserver"];
//Exchannge server
oField.Value = "xxx.xxx.com";
oFields.Update();

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

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

oField = oFields["http://schemas.microsoft.com/cdo/
configuration/sendemailaddress"];
oField.Value = "xx*@xxxx.com";
oFields.Update();

oField = oFields["http://schemas.microsoft.com/cdo/
configuration/smtpuserreplyemailaddress"];
oField.Value = "xx*@xxxx.com";
oFields.Update();
oField = oFields["http://schemas.microsoft.com/cdo/
configuration/sendusername"];
//My domain and username
oField.Value = @"xxx\xxxx";
oFields.Update();

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

oMsg.TextBody = "Hello, how are you doing?";
oMsg.From = "xx*@xxxx.com";
oMsg.To = "xx*@xxxx.com";
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 1587

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

Similar topics

15
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
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...
5
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...
11
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...
8
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...
9
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...
1
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...
8
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...
0
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...
0
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...

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.