473,569 Members | 2,700 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SmtpMail.Send problems

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 = "my**@baxglobal .com"
.To = "ce*****@baxglo bal.com"
.Subject = "Test SMTP"
End With

SmtpMail.Send(o Mail)
'END CODE

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

2) If I add
SmtpMail.SmtpSe rver = "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 ce*****@baxglob al.com

I can enable relaying for localhost, but is this necessary? Is there an
different way for it to be coded? Thanks in advance.
Nov 17 '05 #1
6 2443
Hi,

have you checked these:
http://www.asp.net/Forums/ShowPost.a...&PostID=268037
http://www.asp.net/Forums/ShowPost.a...1&PostID=25229

They should answer your question.

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist
"Cameron Eckman" <ce*****@baxglo bal.com> wrote in message
news:OY******** ******@TK2MSFTN GP12.phx.gbl...
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 = "my**@baxglobal .com"
.To = "ce*****@baxglo bal.com"
.Subject = "Test SMTP"
End With

SmtpMail.Send(o Mail)
'END CODE

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

2) If I add
SmtpMail.SmtpSe rver = "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 ce*****@baxglob al.com

I can enable relaying for localhost, but is this necessary? Is there an
different way for it to be coded? Thanks in advance.

Nov 17 '05 #2
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.
--
Peter O'Reilly

Nov 17 '05 #3
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.MailMessag e()

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.S mtpServer = "<smtp server>"
Mail.SmtpMail.S end(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
"Teemu Keiski" <jo****@aspalli ance.com> wrote in message news:<#n******* *******@tk2msft ngp13.phx.gbl>. ..
Hi,

have you checked these:
http://www.asp.net/Forums/ShowPost.a...&PostID=268037
http://www.asp.net/Forums/ShowPost.a...1&PostID=25229

They should answer your question.

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist
"Cameron Eckman" <ce*****@baxglo bal.com> wrote in message
news:OY******** ******@TK2MSFTN GP12.phx.gbl...
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 = "my**@baxglobal .com"
.To = "ce*****@baxglo bal.com"
.Subject = "Test SMTP"
End With

SmtpMail.Send(o Mail)
'END CODE

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

2) If I add
SmtpMail.SmtpSe rver = "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 ce*****@baxglob al.com

I can enable relaying for localhost, but is this necessary? Is there an
different way for it to be coded? Thanks in advance.

Nov 17 '05 #4
Hi,

http://www.asp.net/Forums/ShowPost.a...&PostID=268037

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist

"James" <dr*********@ho tmail.com> wrote in message
news:63******** *************** ***@posting.goo gle.com...
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.MailMessag e()

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.S mtpServer = "<smtp server>"
Mail.SmtpMail.S end(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
"Teemu Keiski" <jo****@aspalli ance.com> wrote in message

news:<#n******* *******@tk2msft ngp13.phx.gbl>. ..
Hi,

have you checked these:
http://www.asp.net/Forums/ShowPost.a...&PostID=268037
http://www.asp.net/Forums/ShowPost.a...1&PostID=25229

They should answer your question.

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist
"Cameron Eckman" <ce*****@baxglo bal.com> wrote in message
news:OY******** ******@TK2MSFTN GP12.phx.gbl...
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 = "my**@baxglobal .com"
.To = "ce*****@baxglo bal.com"
.Subject = "Test SMTP"
End With

SmtpMail.Send(o Mail)
'END CODE

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

2) If I add
SmtpMail.SmtpSe rver = "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 ce*****@baxglob al.com

I can enable relaying for localhost, but is this necessary? Is there an different way for it to be coded? Thanks in advance.

Nov 17 '05 #5
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.

--
James Lankford

"Teemu Keiski" <jo****@aspalli ance.com> wrote in message
news:uS******** ******@tk2msftn gp13.phx.gbl...
Hi,

http://www.asp.net/Forums/ShowPost.a...&PostID=268037

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist

"James" <dr*********@ho tmail.com> wrote in message
news:63******** *************** ***@posting.goo gle.com...
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.MailMessag e()

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.S mtpServer = "<smtp server>"
Mail.SmtpMail.S end(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
"Teemu Keiski" <jo****@aspalli ance.com> wrote in message news:<#n******* *******@tk2msft ngp13.phx.gbl>. ..
Hi,

have you checked these:
http://www.asp.net/Forums/ShowPost.a...&PostID=268037
http://www.asp.net/Forums/ShowPost.a...1&PostID=25229

They should answer your question.

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist
"Cameron Eckman" <ce*****@baxglo bal.com> wrote in message
news:OY******** ******@TK2MSFTN GP12.phx.gbl...
> 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 = "my**@baxglobal .com"
> .To = "ce*****@baxglo bal.com"
> .Subject = "Test SMTP"
> End With
>
> SmtpMail.Send(o Mail)
> 'END CODE
>
> 1) I receive the following error:
> The "SendUsing" configuration value is invalid.
>
> 2) If I add
> SmtpMail.SmtpSe rver = "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 ce*****@baxglob al.com
>
> I can enable relaying for localhost, but is this necessary? Is
there an > different way for it to be coded? Thanks in advance.
>
>


Nov 17 '05 #6
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.
--
Peter O'Reilly

Nov 17 '05 #7

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

Similar topics

3
1458
by: Edwin G. Castro | last post by:
I'm using the System.Web.Mail.SmtpMail class to send email from an app I wrote. I needed to install IIS to get it to send the messages even though I wanted to use an existing SMTP server. Anyway, I got it to send messages for me which is great.... Unfortunately, I do not receive the complete contents of the Body. I have ran a few tests to see...
2
2536
by: Leszek | last post by:
Hello, I have created a simple code to send emails using the MailMessage class and the SmtpMail.Send() method: MailMessage mail = new MailMessage(); mail.From = echidna@somewhere.com; // hard-coded mail.To = platypus@somewhere.com; mail.Subject = "Test"; mail.Body = strMessage;
1
2690
by: Jens Øster | last post by:
Hi I am writing a ASP.NET web application that must sent some e-mails. I get the exception “Could not access 'CDO.Message' object” when I call SmtpMail.Send. This only happens when I send e-mail addresses out side my company walls. When the e-mail is send on some one in my company it works perfect. I think it is a relay issue. Our...
3
9246
by: Jens | last post by:
Hi I am writing a ASP.NET web application that must sent some e-mails. I get the exception “Could not access 'CDO.Message' object” when I call SmtpMail.Send. This only happens when I send e-mail addresses out side my company walls. When the e-mail is send on some one in my company it works perfect. I think it is a relay issue. Our...
4
7534
by: Aren Cambre | last post by:
Why does SmtpMail.Send throw an exception if the MailMessage's BodyFormat = MailFormat.Html? I've searched all over the place and cannot find a solution anywhere. I am running this on Windows XP SP2, and IIS's SMTP and WWW servers are installed. Here is the error trace: System.Web.HttpException: Could not access 'CDO.Message' object. --->...
3
1559
by: aslantifosi | last post by:
hi all, My question is about that i use a smpt server which is running on a different machine from my webserver machine. And i can authenticate with a user and password. I use SmtpMail class. i set the smtpserver property. but how can i authenticate with my user and pass? for ex: my user :xxxx@xxx.com pass :12345
9
1845
by: Russell Stevens | last post by:
I generate pdf files on my server and allow users to access them via a browser and also email them. Most files work fine whether the user uses his browser or gets an email with a pdf attachment which he can then open with Acrobat. All my pdf files work fine via a browser, but some are corrupted by one byte when sent as an email attachment....
3
2028
by: plex4r | last post by:
I want to add guaranteed delivery (or at least guarantee sent) to some code using SmtpMail.Send(). The method is void. Does Send() throw exceptions if it cannot connect to the Smtp server or has some other error? I could then store the message on an MSMQ and retry later. What do you think of this design?
2
2793
by: joseph2000 | last post by:
Hi, I have problem with e-mails which are being send via System.Web.Mail.SmtpMail class but before describing the problem itself first I'd like to show shortly what I'm doing on the server. The following code is being executed on the server to send e-mails to clients (.NET Framework 1.1): .... EmailsInQueCollection eqc =...
0
7612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7673
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7970
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1213
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.