Cannot send email using SMTP

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
 
G

George Durzi

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.
 
B

Bob Jones

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
 
M

MS News \(MS LVP\)

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

or try blank ""
 
G

George Durzi

check every folder in your \inetpub\mailroot directory.
Is the message getting stuck there?
 
B

Bob Jones

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
 
B

Bob Jones

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
 
B

Bob Jones

George,

Got it working

See thread from Michal

Thanks again for your help.

Bob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top