473,846 Members | 1,967 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Send Email with CDonts and C#

ASP.Net, C#, Email message, CDonts not CDO

I am writing an ASP.Net application where I cannot use CDO. I must use
CDonts. I cannot find an example of this on the Internet. I only see
examples on how to do this using CDO. Unfortunately, I don't have that
option. I must use C# and CDonts. Do you have any ideas or code?

In traditional ASP, the code was:
objMail = Server.CreateOb ject("CDONTS.Ne wMail");
objMail.To = "so*****@somepl ace.com";
objMail.From = "me@me.com" ;
objMail.Subject = "Test";
objMail.Importa nce = 2;
objMail.MailFor mat = 0;
objMail.BodyFor mat = 0;
objMail.Body = "Test message";
objMail.Send;

How is that ported to .Net? What do you declare the objMail variable?
I tried it as an object variable and .Net didn't like it.

Thanks,
Marty

Dont reply to this email...it is fake.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 15 '05 #1
2 9388


--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE
"microsoft.publ ic.dotnet.langu ages.csharp" <ma********@som eplace.plc> wrote
in message news:uc******** ******@TK2MSFTN GP11.phx.gbl...
ASP.Net, C#, Email message, CDonts not CDO

I am writing an ASP.Net application where I cannot use CDO. I must use
CDonts. I cannot find an example of this on the Internet. I only see
examples on how to do this using CDO. Unfortunately, I don't have that
option. I must use C# and CDonts. Do you have any ideas or code?

In traditional ASP, the code was:
objMail = Server.CreateOb ject("CDONTS.Ne wMail");
objMail.To = "so*****@somepl ace.com";
objMail.From = "me@me.com" ;
objMail.Subject = "Test";
objMail.Importa nce = 2;
objMail.MailFor mat = 0;
objMail.BodyFor mat = 0;
objMail.Body = "Test message";
objMail.Send;

How is that ported to .Net? What do you declare the objMail variable?
I tried it as an object variable and .Net didn't like it.

Thanks,
Marty

Dont reply to this email...it is fake.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Nov 15 '05 #2
Hi Marty,

You can either:

a) Use the System.Web.Mail namespace to send mail through the .NET managed
wrapper for CDO.
b) Add a COM reference to cdonts.dll to your project. This will add a new
namespace, most likely
"cdonts", where the NewMailClass type will appear and you will then use this
class as any usual
..NET class.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"microsoft.publ ic.dotnet.langu ages.csharp" <ma********@som eplace.plc> wrote
in message news:uc******** ******@TK2MSFTN GP11.phx.gbl...
ASP.Net, C#, Email message, CDonts not CDO

I am writing an ASP.Net application where I cannot use CDO. I must use
CDonts. I cannot find an example of this on the Internet. I only see
examples on how to do this using CDO. Unfortunately, I don't have that
option. I must use C# and CDonts. Do you have any ideas or code?

In traditional ASP, the code was:
objMail = Server.CreateOb ject("CDONTS.Ne wMail");
objMail.To = "so*****@somepl ace.com";
objMail.From = "me@me.com" ;
objMail.Subject = "Test";
objMail.Importa nce = 2;
objMail.MailFor mat = 0;
objMail.BodyFor mat = 0;
objMail.Body = "Test message";
objMail.Send;

How is that ported to .Net? What do you declare the objMail variable?
I tried it as an object variable and .Net didn't like it.

Thanks,
Marty

Dont reply to this email...it is fake.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Nov 15 '05 #3

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

Similar topics

7
2553
by: Mario Leduc | last post by:
Hi, I have a page that sends user comments with CDONTS, works fine. Until I put a URL (http://192.168.0.1). If I use http://domain.com it works fine. Why with the numeric URL, CDONTS does not send the mail?? Thanks
2
1890
by: Jammer | last post by:
Can someone give me some sample code to use CDONTS.new to send email with an attachment? I've got sample code from the following website; http://msdn.microsoft.com/library/en-us/cdo/html/_denali_newmail_object_cdonts_library_.asp?frame=true But, I'm having trouble GETTING the relevant field from my HTML form! I can't seem to be able to get the field property. :( It just comes up as a blank.
4
4339
by: CK | last post by:
Hi all, I know this question is stupid. But i need some advice for this. I am trying to develop a website, which will allow the user send to order form to the admin email. I am planning to use the CDONTS component method. Can I just to localhost server to test, whether the form can be send up to the admin's email. Or I must have the Hosting server to do that. Can Anyone suggest me, how to I test my scripts can be successfully run (at...
2
3682
by: Marty | last post by:
ASP.Net, C#, Email message, CDonts not CDO I am writing an ASP.Net application where I cannot use CDO. I must use CDonts. I cannot find an example of this on the Internet. I only see examples on how to do this using CDO. Unfortunately, I don't have that option. I must use C# and CDonts. Do you have any ideas or code? In traditional ASP, the code was: objMail = Server.CreateObject("CDONTS.NewMail");
6
11199
by: DigitalRick | last post by:
I have been running CDONTS in my ASPpages to send emails to me sent from my guestbook. It had been working fine untill I upgraded to Server 2003 (I am also running Exchange 2003) all locally. I will include the code I originally used. I understand I should switch from CDONTS to CDO mail but after several sttempts I am finding a very hard time getting the new CDO mail to work properly. Any assistance with this would be greatly...
2
4542
by: Paul Turley | last post by:
How do I format a message so it shows up as a web page in the mail reader. In the body of my message, I'm including a '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Traditional//EN">' tag and standard <html><body> tags but this all shows up as text in the message. What's the secret? -- Paul Turley, MCSD, MCAD, MCT, MSF Practitioner, A+ Technician paul@createsolutions.net
5
8798
by: Andreas | last post by:
I am working with three computers, my developing computer, a Web Server and a Mail Server (Exchange). I am trying to send a email from the Web Server via the Mail Server to a valid email address with this code: MailMessage msgMail = new MailMessage(); msgMail.To = "test@address.com"; msgMail.From = "from@address.com"; msgMail.Subject = "Mail Example Subject";
7
2813
by: Ron Hinds | last post by:
Our webserver is currently Windows 2000 Server. Many of our pages send mail using the CDONTS object library. It is simple and very straightforward. We have built a new webserver using Windows Server 2003 Web Edition. Unfortunately, 2003 doesn't have the CDONTS library anymore. I'm looking for a new solution that is preferably as easy to use. But I would also like some additional functionality. The webserver will be hosting five web...
3
3470
by: Prasad | last post by:
Hi all, I had to write a page in ASP which sends an email. I googled and was able to write the following code: <html> <body> <% Set Mail = Server.CreateObject("CDONTS.NewMail") Mail.To = "XXXXXXXXXXXX@XXXXXX.COM"
0
9725
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
10976
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
10705
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,...
0
10330
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9477
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
7877
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
7050
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4521
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
4111
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.