I'm puzzled by this situation. I'm running on Windows XP Pro 2002 SP 2. I
started on an ASP.Net project, initially using the standard SmtpServer and
MailMessage classes. For testing, I used the same e-mail address for From:
and To:, my personal e-mail address on my ISP. I do not have an e-mail
server set up on my machine, though I do have the SMTP service running.
Everything was working. I could send a mail message from my ASP.Net app.,
running on my machine, and it would show up in my personal e-mail, through my
ISP, showing that it was From: <my personal address>, and To: <my personal
address>. This is the way I wanted it. So far, so good.
I'm now trying out a third-party .Net SMTP component, because I want some
additional functionality that the standard SmtpServer class doesn't offer. I
try sending a message the same way with it and it fails. I'm not sure why.
In the log output, it shows (modified a bit):
[11/9/2004 22:51:19:313]Connecting to localhost (Try 1 of 4)
[11/9/2004 22:51:19:313]-----> EHLO localhost
[11/9/2004 22:51:19:313]<----- 220 MarkNotebook Microsoft ESMTP MAIL
Service, Version: 6.0.2600.2180 ready at Tue, 9 Nov 2004 22:51:19 -0800
[11/9/2004 22:51:19:563]<----- 250-MarkNotebook Hello [127.0.0.1]
[11/9/2004 22:51:19:563]<----- 250-SIZE 2097152
[11/9/2004 22:51:19:563]<----- 250-PIPELINING
[11/9/2004 22:51:19:563]<----- 250-DSN
[11/9/2004 22:51:19:563]<----- 250-ENHANCEDSTATUSCODES
[11/9/2004 22:51:19:563]<----- 250-8bitmime
[11/9/2004 22:51:19:563]<----- 250-BINARYMIME
[11/9/2004 22:51:19:563]<----- 250-CHUNKING
[11/9/2004 22:51:19:563]<----- 250-VRFY
[11/9/2004 22:51:19:563]<----- 250 OK
[11/9/2004 22:51:19:563]Connected
[11/9/2004 22:51:19:563]Addressing the message
[11/9/2004 22:51:19:563]-----> MAIL FROM:<personal mail address>
[11/9/2004 22:51:19:563]<----- 250 2.1.0 <personal mail address>....Sender OK
[11/9/2004 22:51:19:563]-----> RCPT TO:<personal mail address>
[11/9/2004 22:51:19:563]<----- 550 5.7.1 Unable to relay for <personal mail
address>
[11/9/2004 22:51:19:563]Rejected(1): <personal mail address>[11/9/2004
22:51:19:563]There are no valid recipients.
Common remedy: Try using authentication or check the log file for more error
message details.
[11/9/2004 22:51:19:563]-----> QUIT
[11/9/2004 22:51:19:563]<----- 221 2.0.0 MarkNotebook Service closing
transmission channel
[11/9/2004 22:51:19:623]
What I realized later is a lot of this was output from my SMTP server. So I
don't think this is the fault of the component. I found out how to connect
up to the SMTP server myself using telnet. I put in the same commands as
listed above, and got the same result. For whatever reason it's not relaying
the message, and I'm not sure why. I asked the component vendor about this
and they said it had to do with authentication, that the SMTP server wants a
username and password before allowing the message to go through. This
doesn't make sense to me though, because when I used the standard SmtpServer
class in .Net, everything worked fine. It doesn't even have username and
password properties. And I don't understand why sending my messages with the
standard SmtpServer class worked fine and this doesn't. What's the
difference between them?
I've tried looking this up in the MSDN help, and I've found some articles on
the SMTP server relaying messages, but usually they talk about Exchange
Server in conjunction with this, using it to configure the routing. Is there
a way for me to fix this with what I've got?
Thanks