SmtpMail.Send problems

  • Thread starter Thread starter Cameron Eckman
  • Start date Start date
C

Cameron Eckman

I get various errors when I try to use email on the machine I have. XP
professional. It works fine on another machine with NT 2000 server. Below
is the code:

'BEGIN CODE
Dim oMail As New MailMessage()

With oMail
.From = "(e-mail address removed)"
.To = "(e-mail address removed)"
.Subject = "Test SMTP"
End With

SmtpMail.Send(oMail)
'END CODE

1) I receive the following error:
The "SendUsing" configuration value is invalid.

2) If I add
SmtpMail.SmtpServer = "localhost"

A) the SMTP server is stopped, I receive the following error:
The transport failed to connect to the server

B) the SMTP server is running, I receive the following error:
Unable to relay for (e-mail address removed)

I can enable relaying for localhost, but is this necessary? Is there an
different way for it to be coded? Thanks in advance.
 
Within IIS's Internet Service Manager (ISM) console, check the SMTP virtual
mail server settings - specifically its property pages. Most likely you
will need to assign the IP address of the machine for the virtual smtp mail
server. By default, no address is specified.
Hope this helps.
 
Hello,

I am attempting to send email using an ASP.NET application running on
Windows Server 2003, and I'm getting the error message:

"The transport failed to connect to the server."

I have pretty much tried every suggestion I've found thus far and I
get this error no matter what I do. I did try using the CDOSYS test
from Microsoft as a test for the smtpserver, and it'll send that way.
Here's my existing code:

Public Sub SendMail()

Dim myMailMsg As New Mail.MailMessage()

With myMailMsg
.To = "<Send to address">
.From = <"Send From Address">
.Subject = "Test message"
.Body = "This is a test."
.BodyFormat = Mail.MailFormat.Text
End With

Mail.SmtpMail.SmtpServer = "<smtp server>"
Mail.SmtpMail.Send(myMailMsg)

End Sub

For my SmtpServer, I've used localhost, smarthost, the actual value of
our corporate smtp server address - nothing changes. I always get that
error message.

Can someone please help me?

Thanks,

James
 
Hi Teemu,

Thanks for replying, but as stated in my prior posting, I have already
tried those links with no resolution. Is there anything else I'm missing? I
even tried trapping the error (as a test, of course) to resume but I still
get the same message.
 
Within IIS's Internet Service Manager (ISM) console, check the SMTP virtual
mail server settings - specifically its property pages. Most likely you
will need to assign the IP address of the machine for the virtual smtp mail
server. By default, no address is specified.
Hope this helps.
 
Back
Top