473,320 Members | 1,993 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,320 software developers and data experts.

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.CreateObject("CDONTS.NewMail");
objMail.To = "so*****@someplace.com";
objMail.From = "me@me.com";
objMail.Subject = "Test";
objMail.Importance = 2;
objMail.MailFormat = 0;
objMail.BodyFormat = 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 9345


--
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.public.dotnet.languages.csharp" <ma********@someplace.plc> wrote
in message news:uc**************@TK2MSFTNGP11.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.CreateObject("CDONTS.NewMail");
objMail.To = "so*****@someplace.com";
objMail.From = "me@me.com";
objMail.Subject = "Test";
objMail.Importance = 2;
objMail.MailFormat = 0;
objMail.BodyFormat = 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.public.dotnet.languages.csharp" <ma********@someplace.plc> wrote
in message news:uc**************@TK2MSFTNGP11.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.CreateObject("CDONTS.NewMail");
objMail.To = "so*****@someplace.com";
objMail.From = "me@me.com";
objMail.Subject = "Test";
objMail.Importance = 2;
objMail.MailFormat = 0;
objMail.BodyFormat = 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
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...
2
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; ...
4
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...
2
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...
6
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...
2
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...
5
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...
7
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...
3
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 =...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.