A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Exchange, Outlook and SMTP programming with CDO



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old April 19th 07, 12:44 AM posted to microsoft.public.outlook.program_vba
Sachin
external usenet poster
 
Posts: 1
Default Exchange, Outlook and SMTP programming with CDO

Hello All,

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

I am using outlook 2003 and exchange server 2003 with c# as a language

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 = ";
oFields.Update();

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

oField =
oFields["http://schemas.microsoft.com/cdo/configuration/smtpuserreplyemailaddress"];
oField.Value = ";
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 = ";
oMsg.To = ";
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
  #2  
Old April 19th 07, 03:43 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Exchange, Outlook and SMTP programming with CDO

Id you want the items to show up in Outlook you need to use the Outlook
object model or WebDAV, not CDO. The Outlook object model is not suited to
run in a service, so your only other option is to use WebDAV (CDO 1.21 is
not supported for use with .NET code).

I'd suggest posting in an Exchange group, since you won't end up using any
Outlook code at all.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Sachin" wrote in message
...
Hello All,

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

I am using outlook 2003 and exchange server 2003 with c# as a language

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 = ";
oFields.Update();

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

oField =
oFields["http://schemas.microsoft.com/cdo/configuration/smtpuserreplyemailaddress"];
oField.Value = ";
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 = ";
oMsg.To = ";
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


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ÎÞ·¨ÕÒµ½Ö÷»ú¡°SMTP¡±¡£Çë¼ì²éÊäÈëµÄ·þÎñÆ÷ÃûÊÇ·ñÕýÈ·¡£ ÕÊ»§: 'POP3', ·þÎñÆ÷: 'SMTP', ЭÒé: SMTP, ¶Ë¿Ú: 25, °²È«(SSL): ·ñ, Ì×½Ó×Ö´íÎó: 11001, ´íÎóºÅ: 0x800CCC0D John Smith Outlook Express 0 September 5th 06 02:15 AM
Outlook programming Jerod Mills Outlook and VBA 3 July 27th 06 05:17 PM
Choice of programming tool for Outlook programming [email protected] Outlook and VBA 4 July 13th 06 11:48 AM
ÎÞ·¨ÕÒµ½Ö÷»ú¡°smtp¡±¡£Çë¼ì²éÊäÈëµÄ·þÎñÆ÷ÃûÊÇ·ñÕýÈ·¡£ ÕÊ»§: 'pop3', ·þÎñÆ÷: 'smtp', ЭÒé: SMTP, ¶Ë¿Ú: 25, °²È«(SSL): ·ñ, Ì×½Ó×Ö´íÎó: 11001, ´íÎóºÅ: 0x800CCC0D Outlook Express 0 June 17th 06 10:44 AM
I need to save a contact in SMTP format not exchange format. JAX Outlook - Using Contacts 0 February 15th 06 02:51 PM


All times are GMT +1. The time now is 01:28 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.