Hi all
I am currently trying to send and email via exchange except I'm having a
nightmare getting it working, you'd think this would be pertty simple
wouldn't you?
I have added a reference to cdoex.dll in my project and this is my code:
ADODB.Connectio nClass conn = null;
CDO.MessageClas s msg = new CDO.MessageClas s();C
CDO.Configurati onClass config = new CDO.Configurati onClass();
conn = new ADODB.Connectio nClass();
conn.Provider = "MSDAIPP.DSO.1" ;
conn.Open("http ://servername/exchange/mailboxname", "username", "password",
-1);
config.Fields[CDO.CdoConfigur ation.cdoSendUs erReplyEmailAdd ress].Value =
so*******@somet hing.com;
config.Fields[CDO.CdoConfigur ation.cdoSendEm ailAddress].Value =
so*******@somet hing.com;
config.Fields[CDO.CdoConfigur ation.cdoSendUs erName].Value = "username";
config.Fields[CDO.CdoConfigur ation.cdoSendPa ssword].Value = "password";
config.Fields[CDO.CdoConfigur ation.cdoSendUs ingMethod].Value =
CDO.CdoSendUsin g.cdoSendUsingE xchange;
config.Fields[CDO.CdoConfigur ation.cdoMailbo xURL].Value =
"http://servername/exchange/mailboxname";
config.Fields[CDO.CdoConfigur ation.cdoActive Connection].Value = conn;
config.Fields.U pdate();
msg.Configurati on = config;
msg.To = me@j-media.com;
msg.Subject = "tester";
msg.TextBody = "saf";
msg.Send();
When I run this code i receive an "Unspecifie d Error" which of course helps
no end in solving the issue.
Anyone any ideas or code snippets they would like to share with me about
sending mails with attachments via an exchange account.
--
It''s all fun and games until someone loses an eye, then it''s just fun and
games that you can''t see!