Cannot send email using SMTP

  • Thread starter Thread starter Bob Jones
  • Start date Start date
B

Bob Jones

We have developed a commercial ASP.net application
(personal nutrition management and tracking); we want to
send smtp email from within it.

For our development box, we use WinXP Pro, IIS 5.5,
VisualStudio2002, VB as programing language. Our
test/development version of the web app as hosted on
our "localhost" works fine; our "Default SMTP Virtual
Server" is running (per the IIS console).

Our simple test page (EmailTest.aspx)is in a separate
project, has only a single button and we are trying to
use the following code on the EmailTest.aspx.vb:

Private Sub Button1_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Button1.Click

Dim OK As New Mail.MailMessage()
OK.From = "(e-mail address removed)"
OK.Subject = "Test"
OK.Body = "Trying To Send Email"
OK.To = "(e-mail address removed)"
Mail.SmtpMail.SmtpServer = "localhost"

Mail.SmtpMail.Send(OK)

End Sub

The line Mail.SmtpMail.Send(OK) always throws an
exception; we always get this error:

The server rejected one or more recipient addresses. The
server response was: 550 5.7.1 Unable to relay for
(e-mail address removed) .

It does not matter who the recipient is, either. We are
connected to the internet via DSL. Otherwise, everything
else related to our stuff seems to work perfectly.

Have spent way too many man hours researching help files,
MSDN KnowledgeBase, etc. No luck. I am sure we are
doing soming wrong, but have no idea what.

Our only prior experience with email code has been with
MS Access using VBA. We know this is our mistake, just do
not know how to help ourselves. Also, the web app is our
first try using ASP.net, etc. Generally, the app works
works great!

Can anyone please help; or provide a good example we can
follow?

FYI, our web site is http://www.cookbookplus.com

If curious, you can see the app using
the "CookBookPlusOnTheWeb" link on the home page.

Or use
http://www.cookbookplus.com/CookBookPlusOnTheWeb/LogInWeb.
aspx for a direct link.

The app is hosted on a Windows Server 2003 system so
whatever we do must work with IIS 6 when we deploy.

Thank you.
Bob Jones
(e-mail address removed)
(e-mail address removed)
4106267564
 
what happens if you change
Mail.SmtpMail.SmtpServer = "localhost"
to
Mail.SmtpMail.SmtpServer = "xxx.xxx.xxx.xxx"
being the IP address

Also, I am running an IIS server that uses SMTP to send email in an
evironment where there is an exchange server. We had to setup something in
the exchange server to allow the IIS email to send SMTP mail.

I think that might be your issue.
 
Hi George,

Thanks for the reply; but no luck.

Tried using our IP instead of "localhost"; get this error
instead: The transport failed to connect to the server.

No Exchange Server involvement here possible either as we
do not use it at all.

I still need help.

Bob
 
"mail.yourSMTPDomainNameHere.com"
"smtp.yourSMTPDomainNameHere.com"

or try blank ""
 
check every folder in your \inetpub\mailroot directory.
Is the message getting stuck there?
 
Using "" generates this error: The "SendUsing"
configuration value is invalid.

Using anything other than "localhost" will generate the
failed to connect...error msg

Thanks for trying; still at a loss.

Bob
 
Hi Michal,

You are a genius!

Got it to work. FINALLY

Life is beautiful again...

Is this information written down anywhere I could have
located it.

Thank you very much.

Bob
 
Back
Top