Connecting Tech Pros Worldwide Forums | Help | Site Map

send email using c# without using CDONTS

Mohammed Abdel-Razzak
Guest
 
Posts: n/a
#1: Nov 16 '05
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
William Stacey [MVP]
Guest
 
Posts: n/a
#2: Nov 16 '05

re: send email using c# without using CDONTS


see other post on this about 1-2 days ago....

--
William Stacey, MVP

"Mohammed Abdel-Razzak" <anonymous@discussions.microsoft.com> wrote in
message news:fe9f01c43ebe$939c7830$a601280a@phx.gbl...[color=blue]
> 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[/color]

Patrick de Ridder
Guest
 
Posts: n/a
#3: Nov 16 '05

re: send email using c# without using CDONTS


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]" <staceywREMOVE@mvps.org> wrote in message
news:%239PymGsPEHA.1160@TK2MSFTNGP09.phx.gbl...[color=blue]
> see other post on this about 1-2 days ago....
>
> --
> William Stacey, MVP
>
> "Mohammed Abdel-Razzak" <anonymous@discussions.microsoft.com> wrote in
> message news:fe9f01c43ebe$939c7830$a601280a@phx.gbl...[color=green]
> > 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[/color]
>[/color]


Wiktor Zychla
Guest
 
Posts: n/a
#4: Nov 16 '05

re: send email using c# without using CDONTS


> 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


Patrick de Ridder
Guest
 
Posts: n/a
#5: Nov 16 '05

re: send email using c# without using CDONTS



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

Not so for general use.
[color=blue]
>
> what I suggest is to search for the implementation of sending mail via[/color]
SMTP.[color=blue]
> it's fast and reliable.
>[/color]

Please give some references.

Patrick.


Chad Z. Hower aka Kudzu
Guest
 
Posts: n/a
#6: Nov 16 '05

re: send email using c# without using CDONTS


"Patrick de Ridder" <wantnospam@all.here> wrote in news:c0e8f$40af53a4
$3e158c36$22044@freeler.nl:[color=blue][color=green]
>> what I suggest is to search for the implementation of sending mail via[/color]
> SMTP.[color=green]
>> it's fast and reliable.[/color]
>
> Please give some references.[/color]

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/
Patrick de Ridder
Guest
 
Posts: n/a
#7: Nov 16 '05

re: send email using c# without using CDONTS


Thanks,
Patrick.

"Chad Z. Hower aka Kudzu" <cpub@hower.org> wrote in message
news:Xns94F1DF501D894cpub@127.0.0.1...[color=blue]
> "Patrick de Ridder" <wantnospam@all.here> wrote in news:c0e8f$40af53a4
> $3e158c36$22044@freeler.nl:[color=green][color=darkred]
> >> what I suggest is to search for the implementation of sending mail via[/color]
> > SMTP.[color=darkred]
> >> it's fast and reliable.[/color]
> >
> > Please give some references.[/color]
>
> 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/[/color]


Patrick de Ridder
Guest
 
Posts: n/a
#8: Nov 16 '05

re: send email using c# without using CDONTS


> "Chad Z. Hower aka Kudzu" <cpub@hower.org> wrote in message[color=blue]
> news:Xns94F1DF501D894cpub@127.0.0.1...[color=green]
> > "Patrick de Ridder" <wantnospam@all.here> wrote in news:c0e8f$40af53a4
> > $3e158c36$22044@freeler.nl:[color=darkred]
> > >> what I suggest is to search for the implementation of sending mail[/color][/color][/color]
via[color=blue][color=green][color=darkred]
> > > SMTP.
> > >> it's fast and reliable.
> > >
> > > Please give some references.[/color]
> >
> > http://www.codeproject.com/useritems/IndySMTP.asp[/color][/color]

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.


psg
Guest
 
Posts: n/a
#9: Nov 16 '05

re: send email using c# without using CDONTS


"Patrick de Ridder" <wantnospam@all.here> wrote in message
news:10060$40b0cd73$3e15996d$21546@freeler.nl...[color=blue]
> The requested name is valid and was found in the database,
> but it doesn't have the correct data being resolved for.[/color]

AFAIK this problem has sth to do with DNS.
[color=blue]
> Resolving hostname smtp.xxxxx.yy[/color]

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

RGDS PSG


Patrick de Ridder
Guest
 
Posts: n/a
#10: Nov 16 '05

re: send email using c# without using CDONTS


Yes, it exists. The app. runs ok if the connection is already established,
but not if it isn't.


"psg" <pgrodzki@ki.net.pl> wrote in message
news:c8qjld$apd$1@b177.ki.net.pl...[color=blue]
> "Patrick de Ridder" <wantnospam@all.here> wrote in message
> news:10060$40b0cd73$3e15996d$21546@freeler.nl...[color=green]
> > The requested name is valid and was found in the database,
> > but it doesn't have the correct data being resolved for.[/color]
>
> AFAIK this problem has sth to do with DNS.
>[color=green]
> > Resolving hostname smtp.xxxxx.yy[/color]
>
> Have you checked if smtp.xxxxx.yy exists?
> Statrt->Run:
> ping smtp.xxxxx.yy
> telnet smtp.xxxxx.yy 25
>
> RGDS PSG
>
>[/color]


psg
Guest
 
Posts: n/a
#11: Nov 16 '05

re: send email using c# without using CDONTS


"Patrick de Ridder" <wantnospam@all.here> wrote in message
news:18e26$40b0d673$3e159d28$22274@freeler.nl...[color=blue]
> Yes, it exists. The app. runs ok if the connection is already established,
> but not if it isn't.[/color]

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


Patrick de Ridder
Guest
 
Posts: n/a
#12: Nov 16 '05

re: send email using c# without using CDONTS


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" <pgrodzki@ki.net.pl> wrote in message
news:c8qp9s$qhn$1@b177.ki.net.pl...[color=blue]
> "Patrick de Ridder" <wantnospam@all.here> wrote in message
> news:18e26$40b0d673$3e159d28$22274@freeler.nl...[color=green]
> > Yes, it exists. The app. runs ok if the connection is already[/color][/color]
established,[color=blue][color=green]
> > but not if it isn't.[/color]
>
> 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[/color]
at[color=blue]
> 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
>
>[/color]



Closed Thread


Similar C# / C Sharp bytes