472,345 Members | 1,624 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,345 software developers and data experts.

System.net.mail.SmtpClient send generates a Syntax error, command unrecognized

Hi,

Have hunted around on the groups and can't find anything, hence.

I've tried this against 2 mail servers (mailtraq and hmailserver) and
it occus with both.

The problems seems to be that when the SMTPClient attaches to the
server and the server sends it greeting message, if anything other than
+OK is received by the client it throws an exception and falls over.
Catching the exception is OK, but the client still falls over.

the hmailServer sends :
+OK POP3
the Mailtraq server sends :
+OK <3148.13349250@MyBoxready for action (Mailtraq
2.8.0.2048/POP3)

and in both cases the SMTPClient blows up in the same way. Is this
class a bit flaky / basic or am I missing something??

During my hunting around on the web people had mentioned creating an
app.exe.config file to capture some logging information, below is the
log I get when I run the app.

System.Net Verbose: 0 : [3680] SmtpClient::.ctor(host=Sage003260,
port=110)
System.Net Information: 0 : [3680] Associating SmtpClient#10549531 with
SmtpTransport#27836922
System.Net Verbose: 0 : [3680] Exiting SmtpClient::.ctor() ->
SmtpClient#10549531
System.Net Verbose: 0 : [3680]
SmtpClient#10549531::Send(MailMessage#49205706)
System.Net Information: 0 : [3680]
SmtpClient#10549531::Send(DeliveryMethod=Network)
System.Net Information: 0 : [3680] Associating SmtpClient#10549531 with
MailMessage#49205706
System.Net Information: 0 : [3680] Associating SmtpTransport#27836922
with SmtpConnection#40198173
System.Net Information: 0 : [3680] Associating SmtpConnection#40198173
with ServicePoint#26239245
System.Net Information: 0 : [3680] Associating SmtpConnection#40198173
with SmtpPooledStream#34826618
System.Net Error: 0 : [3680] Exception in the SmtpClient#10549531::Send
- Syntax error, command unrecognized. The server response was: POP3
System.Net Error: 0 : [3680] at
System.Net.Mail.SmtpConnection.GetConnection(Strin g host, Int32 port)
at System.Net.Mail.SmtpTransport.GetConnection(String host, Int32
port)
at System.Net.Mail.SmtpClient.GetConnection()
at System.Net.Mail.SmtpClient.Send(MailMessage message)
System.Net Verbose: 0 : [3680] Exiting SmtpClient#10549531::Send()

>From home (where I don't have the plethora of firewalls like at work) I
tried to connect to an external email server on my website, which is
hosted at 1-and-1 on a unix box. The SMTPClient worked perfectly well
against that server ( don't know what it is - guessing sendmail).
So my question is, has anybody run into the problem of a non-standard
greeting from an SMTP mail server causing their SMTPClient to top
itself? and If so, what's the work around please.

I considered trying to derive a new class from the SMTPClient that
makes it a little for flexible, but I'm not having much joy so far and
timescales are getting tight - as usual.

TIA

Regards
Howard

Sep 7 '06 #1
0 2271

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

Similar topics

3
by: HoustonComputerGuy | last post by:
I am working on getting my web applications moved to .Net 2.0 and am having some problems with System.Net.Mail. I get the following error when...
1
by: Eric Sheu | last post by:
Greetings, I have been searching the web like mad for a solution to my SMTP problem. I am using Windows Server 2003 and ASP.NET 2.0 w/ C# to send...
2
by: Alex Maghen | last post by:
I want to use the new System.Net.Mail instead of the old System.Web.Mail. I'm getting an error "Hot not specified" when I try to do my last two...
2
by: clevrmnkey | last post by:
I've had nothing but trouble from the System.Net.Mail objects, but I finally need to make them work, and I can't for the life of me see what I'm...
1
by: les | last post by:
I'm getting this error "BC30456: 'IsBodyHtml' is not a member of 'System.Net.Mail.SmtpClient'" when trying to submit a form and send email. If I...
2
by: satnamsarai | last post by:
Using System.Net.Mail: Sometimes I get error 'failure sending mail. Unable to write data to the transport connection: An existing connection was...
4
by: David C | last post by:
I would like to have an email go to 2 email addresses but when I try it by separating with semicolon or comma it fails. Can anyone help? below is...
1
by: WIzmanG | last post by:
Hi all I am having trouble with sending email via a C#2.0 application, I use the same settings as I use in Outlook but I cannot get email to send....
2
by: btcoder | last post by:
Hi, my jsp page uses sun.net.smtp.SmtpClient to send email. It worked fine until the hosted location was moved to another server. Now it generates...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...

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.