473,654 Members | 3,264 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Exchange Sending Mail

Gaz
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!
Nov 17 '05 #1
2 11063
Why not just use System.Web.Mail namespace to send mail to the exchange
server?

http://msdn.microsoft.com/library/de...temwebmail.asp

HTH

Ollie Riches

"Gaz" <Ga*@discussion s.microsoft.com > wrote in message
news:50******** *************** ***********@mic rosoft.com...
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!

Nov 17 '05 #2
Gaz
I want the mail to drop into the sent items of a certain users mailbox, hence
the reason for sending via exchange and not just smtp.
--
It''''''''s all fun and games until someone loses an eye, then it''''''''s
just fun and games that you can''''''''t see!
"Ollie Riches" wrote:
Why not just use System.Web.Mail namespace to send mail to the exchange
server?

http://msdn.microsoft.com/library/de...temwebmail.asp

HTH

Ollie Riches

"Gaz" <Ga*@discussion s.microsoft.com > wrote in message
news:50******** *************** ***********@mic rosoft.com...
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!


Nov 17 '05 #3

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

Similar topics

0
4657
by: Nitec Dev | last post by:
Our setup: server1 ASP database running on IIS5, Outlook 2000 and SQL 2000 on Windows 2000. Server2 runs Windows 2000 with Exchange 2000 using CDO 1.2 MAPI Sessions. Clients use IE5/6 and had Outlook 2000 installed. Upgraded to ASP running on IIS6, Outlook 2000 and SQL 2000 on Windows 2003. Server2 runs windows 2003 with Exchange 2003 using CDO 1.2 MAPI Sessions. Clients use IE5/6 and have Outlook 2000/2003 installed.
3
6261
by: martin smith | last post by:
Here's the scenario. I'm currently using cdosys/asp to send mail to our SMTP server. We use a product called MailFilter to check for SPAM. It doesn't work very well. If MailFilter isn't working cdosys also has problems and emails don't get sent. As these email are confirmations for customer's bookings this means lots of customers calling to see where their confirmation emails have gone. The root of the problem is MailFilter but that here...
1
1820
by: Jim in Arizona | last post by:
I have no idea how to get started, really, but I am looking for a way to have an email sent via an ASP page via our Exchange 2000 server. I have a fairly simple asp page that displays data from a SQL 2000 database in the form of web links. A part of this page allows people to post links to the database for display. When someone posts a link, I would like an email sent to me with the data (link) that they posted through the ASP page. ...
2
3145
by: Eric Timely | last post by:
After a trust with exchange server established the xp_SendMail gives the following error: xp_sendmail: failed with mail error 0x80070005 Prior to the trust everything worked fine. I have tried the following: 1)Checking SQL and SQLAgents accounts all match up with default mail profile.
2
3511
by: RedEye | last post by:
Hello, I am trying to create a class to send email via POP3 or Exchange. Everything works fine when sending via POP3 but fails when sending via exchange. Error: Could not access 'CDO.Message' object. The following code works fine in a VB.Net test app but fails on the web. Does anyone have an idea why??
8
4362
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...
1
2942
by: Gilbert Cheung | last post by:
Hello. I am writing a website for my company. There is a sign-up form that requires us to send a confirmation email to our customer. Our company uses Exchange Server 2000 as our mail server. We decided not to implement any smtp server as that may post some additional security risk. The question is, how can I write an ASP.NET 1.1 script (in C#, though I think there is not much difference between C# and VB.NET) that can send email,...
8
2842
by: Michel Posseth [MCP] | last post by:
Hi does someone has experience with this ?? i have made a lot of apps in the past that were capable of sending e-mails the server i then talked to was a Linux SMTP server and it worked great Now i work in a company with a MS exchange server and would like to send some e-mails however i can`t get it to work at all error is : ( translated form the dutch language )
2
5744
abdoelmasry
by: abdoelmasry | last post by:
Hi men i have big problem with microsoft exchange server 2003 i installed exchange server as main mail server to use it on in company i have static real ip address im sending and receiving mails good but
0
8294
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
8816
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...
0
8709
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7309
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6162
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
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4297
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2719
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
1597
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.