By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,364 Members | 1,278 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,364 IT Pros & Developers. It's quick & easy.

send email using c# without using CDONTS

P: n/a
dear sirs
i want to send email using c#
but i don`t want to use CDONTS
or tell me how can i use it
i don`t know any thing about CDONTS

thanks
Nov 16 '05 #1
Share this Question
Share on Google+
11 Replies


P: n/a
see other post on this about 1-2 days ago....

--
William Stacey, MVP

"Mohammed Abdel-Razzak" <an*******@discussions.microsoft.com> wrote in
message news:fe****************************@phx.gbl...
dear sirs
i want to send email using c#
but i don`t want to use CDONTS
or tell me how can i use it
i don`t know any thing about CDONTS

thanks


Nov 16 '05 #2

P: n/a
The old messages re the subject are unavailable.

I used this routine. Works ok. There is a limit on size. Depends on OS.

using System;
using System.Drawing;
using System.Windows.Forms;
using System.Diagnostics;

namespace TeleM
{

public class Email:Form
{
private string e_address;
private string subject;
private string body;

public Email(string e_address, string subject, string body)
{
this.e_address=e_address;
this.subject=subject;
this.body=body;
do_mail();
}
private void do_mail()
{
try
{
string message = string.Format( "mailto:{0}?subject={1}&body={2}",
e_address, subject, body );
Process.Start( message );
}
catch
{
MessageBox.Show("Message is too
big.","Error",MessageBoxButtons.OK,MessageBoxIcon. Warning);
}
}
}
}

"William Stacey [MVP]" <st***********@mvps.org> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
see other post on this about 1-2 days ago....

--
William Stacey, MVP

"Mohammed Abdel-Razzak" <an*******@discussions.microsoft.com> wrote in
message news:fe****************************@phx.gbl...
dear sirs
i want to send email using c#
but i don`t want to use CDONTS
or tell me how can i use it
i don`t know any thing about CDONTS

thanks

Nov 16 '05 #3

P: n/a
> string message = string.Format( "mailto:{0}?subject={1}&body={2}",

the Internet Explorer mailto protocol has some serious drawback. the URL
size cannot exceed 2kb. so this is useless in general.

what I suggest is to search for the implementation of sending mail via SMTP.
it's fast and reliable.

Regards,
Wiktor Zychla
Nov 16 '05 #4

P: n/a

"Wiktor Zychla" <us**@nospam.com.eu> wrote in message
news:u%****************@TK2MSFTNGP12.phx.gbl...
string message = string.Format( "mailto:{0}?subject={1}&body={2}",
the Internet Explorer mailto protocol has some serious drawback. the URL
size cannot exceed 2kb. so this is useless in general.


Not so for general use.

what I suggest is to search for the implementation of sending mail via SMTP. it's fast and reliable.


Please give some references.

Patrick.
Nov 16 '05 #5

P: n/a
"Patrick de Ridder" <wa********@all.here> wrote in news:c0e8f$40af53a4
$3*************@freeler.nl:
what I suggest is to search for the implementation of sending mail via

SMTP.
it's fast and reliable.


Please give some references.


http://www.codeproject.com/useritems/IndySMTP.asp
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"

Make your ASP.NET applications run faster
http://www.atozed.com/IntraWeb/
Nov 16 '05 #6

P: n/a
Thanks,
Patrick.

"Chad Z. Hower aka Kudzu" <cp**@hower.org> wrote in message
news:Xn******************@127.0.0.1...
"Patrick de Ridder" <wa********@all.here> wrote in news:c0e8f$40af53a4
$3*************@freeler.nl:
what I suggest is to search for the implementation of sending mail via

SMTP.
it's fast and reliable.


Please give some references.


http://www.codeproject.com/useritems/IndySMTP.asp
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"

Make your ASP.NET applications run faster
http://www.atozed.com/IntraWeb/

Nov 16 '05 #7

P: n/a
> "Chad Z. Hower aka Kudzu" <cp**@hower.org> wrote in message
news:Xn******************@127.0.0.1...
"Patrick de Ridder" <wa********@all.here> wrote in news:c0e8f$40af53a4
$3*************@freeler.nl:
> what I suggest is to search for the implementation of sending mail via SMTP.
> it's fast and reliable.

Please give some references.


http://www.codeproject.com/useritems/IndySMTP.asp


When I set up the email program I get this error message:

The requested name is valid and was found in the database,
but it doesn't have the correct data being resolved for.

This error occurs in Form1

at this line:

LSMTP.Send(LMsg);

The bottom text area in Form1 says:
Resolving hostname smtp.xxxxx.yy

Please assist.

Patrick.
Nov 16 '05 #8

P: n/a
psg
"Patrick de Ridder" <wa********@all.here> wrote in message
news:10***************************@freeler.nl...
The requested name is valid and was found in the database,
but it doesn't have the correct data being resolved for.
AFAIK this problem has sth to do with DNS.
Resolving hostname smtp.xxxxx.yy


Have you checked if smtp.xxxxx.yy exists?
Statrt->Run:
ping smtp.xxxxx.yy
telnet smtp.xxxxx.yy 25

RGDS PSG
Nov 16 '05 #9

P: n/a
Yes, it exists. The app. runs ok if the connection is already established,
but not if it isn't.
"psg" <pg******@ki.net.pl> wrote in message
news:c8**********@b177.ki.net.pl...
"Patrick de Ridder" <wa********@all.here> wrote in message
news:10***************************@freeler.nl...
The requested name is valid and was found in the database,
but it doesn't have the correct data being resolved for.


AFAIK this problem has sth to do with DNS.
Resolving hostname smtp.xxxxx.yy


Have you checked if smtp.xxxxx.yy exists?
Statrt->Run:
ping smtp.xxxxx.yy
telnet smtp.xxxxx.yy 25

RGDS PSG

Nov 16 '05 #10

P: n/a
psg
"Patrick de Ridder" <wa********@all.here> wrote in message
news:18***************************@freeler.nl...
Yes, it exists. The app. runs ok if the connection is already established,
but not if it isn't.


You mean connection with your server in SMTP protocol, or connection with
the Internet?
Most probably it is connection with the Internet that is not established at
the moment of error. Address smtp.xxxxx.yy must be translated to IP with
help of DNS server, if DNS is not available then name query will rise an
error mentioned before. I suggest you to simply catch this exception and
inform user about it in more understandable way. You may also think about
trying to establish a connection, but that is a different issue.

RGDS PSG
Nov 16 '05 #11

P: n/a
When I run the program on a W98 machine, there is no problem at all.
I get the error on a XP machine.
There is no problem if I am already connected to the internet.
An email client previously working ok with smtp now produces socket error
#11004.
Do you have any further suggestions?
Patrick.

"psg" <pg******@ki.net.pl> wrote in message
news:c8**********@b177.ki.net.pl...
"Patrick de Ridder" <wa********@all.here> wrote in message
news:18***************************@freeler.nl...
Yes, it exists. The app. runs ok if the connection is already established, but not if it isn't.
You mean connection with your server in SMTP protocol, or connection with
the Internet?
Most probably it is connection with the Internet that is not established

at the moment of error. Address smtp.xxxxx.yy must be translated to IP with
help of DNS server, if DNS is not available then name query will rise an
error mentioned before. I suggest you to simply catch this exception and
inform user about it in more understandable way. You may also think about
trying to establish a connection, but that is a different issue.

RGDS PSG


Nov 16 '05 #12

This discussion thread is closed

Replies have been disabled for this discussion.