473,586 Members | 2,854 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

smtp.Send fail



I have a form with the following fields:

UserEmail
Subject
Body

When the form is submitted, the email is processed fine. When I try
to add another field to the mm.body (mm.Body = Body.Text &
Listbox1.Select edItem.Text) the smtp.Send fails. Any ideas ?
Code:

<script runat="server">
Protected Sub SendEmail_Click (ByVal sender As Object, ByVal e As
System.EventArg s) Handles SendEmail.Click
'!!! UPDATE THIS VALUE TO YOUR EMAIL ADDRESS
Const ToAddress As String = "ab*@abc.co m"

'(1) Create the MailMessage instance
Dim mm As New Net.Mail.MailMe ssage(UsersEmai l.Text, ToAddress)

'(2) Assign the MailMessage's properties
mm.Subject = Subject.Text
mm.Body = Body.Text & TextBox1.Text
mm.IsBodyHtml = False

'(3) Create the SmtpClient object
Dim smtp As New Net.Mail.SmtpCl ient

'(4) Send the MailMessage (will use the Web.config settings)
smtp.Send(mm)
End Sub
</script>

Sep 22 '07 #1
16 2984
Does the server have smtp

if not you need to tell smtpclient where to find one

Dim message As New MailMessage("se nder@address", "from@addre ss", "Subject",
"Message Text")

Dim emailClient As New SmtpClient("Ema il Server Name")

emailClient.Sen d(message)

<bg********@yah oo.comwrote in message
news:11******** **************@ w3g2000hsg.goog legroups.com...
>

I have a form with the following fields:

UserEmail
Subject
Body

When the form is submitted, the email is processed fine. When I try
to add another field to the mm.body (mm.Body = Body.Text &
Listbox1.Select edItem.Text) the smtp.Send fails. Any ideas ?
Code:

<script runat="server">
Protected Sub SendEmail_Click (ByVal sender As Object, ByVal e As
System.EventArg s) Handles SendEmail.Click
'!!! UPDATE THIS VALUE TO YOUR EMAIL ADDRESS
Const ToAddress As String = "ab*@abc.co m"

'(1) Create the MailMessage instance
Dim mm As New Net.Mail.MailMe ssage(UsersEmai l.Text, ToAddress)

'(2) Assign the MailMessage's properties
mm.Subject = Subject.Text
mm.Body = Body.Text & TextBox1.Text
mm.IsBodyHtml = False

'(3) Create the SmtpClient object
Dim smtp As New Net.Mail.SmtpCl ient

'(4) Send the MailMessage (will use the Web.config settings)
smtp.Send(mm)
End Sub
</script>
Sep 22 '07 #2
sorry did not read your post correctly

try writing

response.write( Body.Text & Listbox1.Select edItem.Text)

see what you get
<bg********@yah oo.comwrote in message
news:11******** **************@ w3g2000hsg.goog legroups.com...
>

I have a form with the following fields:

UserEmail
Subject
Body

When the form is submitted, the email is processed fine. When I try
to add another field to the mm.body (mm.Body = Body.Text &
Listbox1.Select edItem.Text) the smtp.Send fails. Any ideas ?
Code:

<script runat="server">
Protected Sub SendEmail_Click (ByVal sender As Object, ByVal e As
System.EventArg s) Handles SendEmail.Click
'!!! UPDATE THIS VALUE TO YOUR EMAIL ADDRESS
Const ToAddress As String = "ab*@abc.co m"

'(1) Create the MailMessage instance
Dim mm As New Net.Mail.MailMe ssage(UsersEmai l.Text, ToAddress)

'(2) Assign the MailMessage's properties
mm.Subject = Subject.Text
mm.Body = Body.Text & TextBox1.Text
mm.IsBodyHtml = False

'(3) Create the SmtpClient object
Dim smtp As New Net.Mail.SmtpCl ient

'(4) Send the MailMessage (will use the Web.config settings)
smtp.Send(mm)
End Sub
</script>
Sep 22 '07 #3

Also.....

Put a try/catch block around the code and see what that kicks up if anything
"ThatsIT.net.au " <me@thatsitwrot e in message
news:14******** *************** ***********@mic rosoft.com...
Does the server have smtp

if not you need to tell smtpclient where to find one

Dim message As New MailMessage("se nder@address", "from@addre ss",
"Subject", "Message Text")

Dim emailClient As New SmtpClient("Ema il Server Name")

emailClient.Sen d(message)

<bg********@yah oo.comwrote in message
news:11******** **************@ w3g2000hsg.goog legroups.com...
>>

I have a form with the following fields:

UserEmail
Subject
Body

When the form is submitted, the email is processed fine. When I try
to add another field to the mm.body (mm.Body = Body.Text &
Listbox1.Selec tedItem.Text) the smtp.Send fails. Any ideas ?
Code:

<script runat="server">
Protected Sub SendEmail_Click (ByVal sender As Object, ByVal e As
System.EventAr gs) Handles SendEmail.Click
'!!! UPDATE THIS VALUE TO YOUR EMAIL ADDRESS
Const ToAddress As String = "ab*@abc.co m"

'(1) Create the MailMessage instance
Dim mm As New Net.Mail.MailMe ssage(UsersEmai l.Text, ToAddress)

'(2) Assign the MailMessage's properties
mm.Subject = Subject.Text
mm.Body = Body.Text & TextBox1.Text
mm.IsBodyHtml = False

'(3) Create the SmtpClient object
Dim smtp As New Net.Mail.SmtpCl ient

'(4) Send the MailMessage (will use the Web.config settings)
smtp.Send(mm)
End Sub
</script>

Sep 22 '07 #4
On Sep 22, 2:48 am, "ThatsIT.net.au " <me@thatsitwrot e:
sorry did not read your post correctly

try writing

response.write( Body.Text & Listbox1.Select edItem.Text)

see what you get

<bgreer5...@yah oo.comwrote in message

news:11******** **************@ w3g2000hsg.goog legroups.com...


I have a form with the following fields:
UserEmail
Subject
Body
When the form is submitted, the email is processed fine. When I try
to add another field to the mm.body (mm.Body = Body.Text &
Listbox1.Select edItem.Text) the smtp.Send fails. Any ideas ?
Code:
<script runat="server">
Protected Sub SendEmail_Click (ByVal sender As Object, ByVal e As
System.EventArg s) Handles SendEmail.Click
'!!! UPDATE THIS VALUE TO YOUR EMAIL ADDRESS
Const ToAddress As String = "a...@abc.c om"
'(1) Create the MailMessage instance
Dim mm As New Net.Mail.MailMe ssage(UsersEmai l.Text, ToAddress)
'(2) Assign the MailMessage's properties
mm.Subject = Subject.Text
mm.Body = Body.Text & TextBox1.Text
mm.IsBodyHtml = False
'(3) Create the SmtpClient object
Dim smtp As New Net.Mail.SmtpCl ient
'(4) Send the MailMessage (will use the Web.config settings)
smtp.Send(mm)
End Sub
</script>- Hide quoted text -

- Show quoted text -
I tried the response.write and I get a valid text string. When I try
to use Body.Text & Listbox1.Select edItem.text togethor I get the
following failure:

Exception Details: System.Net.Mail .SmtpException: Service not
available, closing transmission channel. The server response was:
Command timeout, closing transmission channel

It's almost as if the server is timing out.

Sep 22 '07 #5
On Sep 22, 2:50 am, "Just Me" <news.microsoft .comwrote:
Also.....

Put a try/catch block around the code and see what that kicks up if anything

"ThatsIT.net.au " <me@thatsitwrot e in message

news:14******** *************** ***********@mic rosoft.com...
Does the server have smtp
if not you need to tell smtpclient where to find one
Dim message As New MailMessage("se nder@address", "from@addre ss",
"Subject", "Message Text")
Dim emailClient As New SmtpClient("Ema il Server Name")
emailClient.Sen d(message)
<bgreer5...@yah oo.comwrote in message
news:11******** **************@ w3g2000hsg.goog legroups.com...
I have a form with the following fields:
UserEmail
Subject
Body
When the form is submitted, the email is processed fine. When I try
to add another field to the mm.body (mm.Body = Body.Text &
Listbox1.Select edItem.Text) the smtp.Send fails. Any ideas ?
Code:
<script runat="server">
Protected Sub SendEmail_Click (ByVal sender As Object, ByVal e As
System.EventArg s) Handles SendEmail.Click
'!!! UPDATE THIS VALUE TO YOUR EMAIL ADDRESS
Const ToAddress As String = "a...@abc.c om"
'(1) Create the MailMessage instance
Dim mm As New Net.Mail.MailMe ssage(UsersEmai l.Text, ToAddress)
'(2) Assign the MailMessage's properties
mm.Subject = Subject.Text
mm.Body = Body.Text & TextBox1.Text
mm.IsBodyHtml = False
'(3) Create the SmtpClient object
Dim smtp As New Net.Mail.SmtpCl ient
'(4) Send the MailMessage (will use the Web.config settings)
smtp.Send(mm)
End Sub
</script>- Hide quoted text -

- Show quoted text -
I put the Try Catch block around the script and it worked. Why would
adding a try catch eliminate the problem?

Sep 22 '07 #6
On Sep 22, 3:15 am, "bgreer5...@yah oo.com" <bgreer5...@yah oo.com>
wrote:
On Sep 22, 2:48 am, "ThatsIT.net.au " <me@thatsitwrot e:


sorry did not read your post correctly
try writing
response.write( Body.Text & Listbox1.Select edItem.Text)
see what you get
<bgreer5...@yah oo.comwrote in message
news:11******** **************@ w3g2000hsg.goog legroups.com...
I have a form with the following fields:
UserEmail
Subject
Body
When the form is submitted, the email is processed fine. When I try
to add another field to the mm.body (mm.Body = Body.Text &
Listbox1.Select edItem.Text) the smtp.Send fails. Any ideas ?
Code:
<script runat="server">
Protected Sub SendEmail_Click (ByVal sender As Object, ByVal e As
System.EventArg s) Handles SendEmail.Click
'!!! UPDATE THIS VALUE TO YOUR EMAIL ADDRESS
Const ToAddress As String = "a...@abc.c om"
'(1) Create the MailMessage instance
Dim mm As New Net.Mail.MailMe ssage(UsersEmai l.Text, ToAddress)
'(2) Assign the MailMessage's properties
mm.Subject = Subject.Text
mm.Body = Body.Text & TextBox1.Text
mm.IsBodyHtml = False
'(3) Create the SmtpClient object
Dim smtp As New Net.Mail.SmtpCl ient
'(4) Send the MailMessage (will use the Web.config settings)
smtp.Send(mm)
End Sub
</script>- Hide quoted text -
- Show quoted text -

I tried the response.write and I get a valid text string. When I try
to use Body.Text & Listbox1.Select edItem.text togethor I get the
following failure:

Exception Details: System.Net.Mail .SmtpException: Service not
available, closing transmission channel. The server response was:
Command timeout, closing transmission channel

It's almost as if the server is timing out.- Hide quoted text -

- Show quoted text -
Well....I guess I do not understand the Try/Catch. The page did not
error out, but the email was never sent as well.

Sep 22 '07 #7
The point of the try catch is this

Try

Your Stuff

Catch ex as exception

'// Look at your exception message here, it will give you more
information

End Try
<bg********@yah oo.comwrote in message
news:11******** *************@g 4g2000hsf.googl egroups.com...
On Sep 22, 3:15 am, "bgreer5...@yah oo.com" <bgreer5...@yah oo.com>
wrote:
>On Sep 22, 2:48 am, "ThatsIT.net.au " <me@thatsitwrot e:


sorry did not read your post correctly
try writing
response.write( Body.Text & Listbox1.Select edItem.Text)
see what you get
<bgreer5...@yah oo.comwrote in message
>news:11******* *************** @w3g2000hsg.goo glegroups.com.. .
I have a form with the following fields:
UserEmail
Subject
Body
When the form is submitted, the email is processed fine. When I try
to add another field to the mm.body (mm.Body = Body.Text &
Listbox1.Select edItem.Text) the smtp.Send fails. Any ideas ?
Code:
<script runat="server">
Protected Sub SendEmail_Click (ByVal sender As Object, ByVal e As
System.EventArg s) Handles SendEmail.Click
'!!! UPDATE THIS VALUE TO YOUR EMAIL ADDRESS
Const ToAddress As String = "a...@abc.c om"
'(1) Create the MailMessage instance
Dim mm As New Net.Mail.MailMe ssage(UsersEmai l.Text, ToAddress)
'(2) Assign the MailMessage's properties
mm.Subject = Subject.Text
mm.Body = Body.Text & TextBox1.Text
mm.IsBodyHtml = False
'(3) Create the SmtpClient object
Dim smtp As New Net.Mail.SmtpCl ient
'(4) Send the MailMessage (will use the Web.config settings)
smtp.Send(mm)
End Sub
</script>- Hide quoted text -
- Show quoted text -

I tried the response.write and I get a valid text string. When I try
to use Body.Text & Listbox1.Select edItem.text togethor I get the
following failure:

Exception Details: System.Net.Mail .SmtpException: Service not
available, closing transmission channel. The server response was:
Command timeout, closing transmission channel

It's almost as if the server is timing out.- Hide quoted text -

- Show quoted text -

Well....I guess I do not understand the Try/Catch. The page did not
error out, but the email was never sent as well.

Sep 22 '07 #8
Hi,

First of all, check if it's a code problem, or if it is a network /
permissions issue, try to send and e-mail using telnet:

http://msexchangeteam.com/archive/20...14/428324.aspx

If you cannot send an e-mail using this, just grab the network admin and
have a chat with him.

I have compiled good info about SMTP and .net (FAQS and Articles):

http://www.tipsdotnet.com/ArticleBlo...TP&PageIndex=0

Good luck
Braulio

/// ------------------------------
/// Braulio Diez
///
/// http://www.tipsdotnet.com
/// ------------------------------


"bg********@yah oo.com" wrote:
On Sep 22, 3:15 am, "bgreer5...@yah oo.com" <bgreer5...@yah oo.com>
wrote:
On Sep 22, 2:48 am, "ThatsIT.net.au " <me@thatsitwrot e:


sorry did not read your post correctly
try writing
response.write( Body.Text & Listbox1.Select edItem.Text)
see what you get
<bgreer5...@yah oo.comwrote in message
>news:11******* *************** @w3g2000hsg.goo glegroups.com.. .
I have a form with the following fields:
UserEmail
Subject
Body
When the form is submitted, the email is processed fine. When I try
to add another field to the mm.body (mm.Body = Body.Text &
Listbox1.Select edItem.Text) the smtp.Send fails. Any ideas ?
Code:
<script runat="server">
Protected Sub SendEmail_Click (ByVal sender As Object, ByVal e As
System.EventArg s) Handles SendEmail.Click
'!!! UPDATE THIS VALUE TO YOUR EMAIL ADDRESS
Const ToAddress As String = "a...@abc.c om"
'(1) Create the MailMessage instance
Dim mm As New Net.Mail.MailMe ssage(UsersEmai l.Text, ToAddress)
'(2) Assign the MailMessage's properties
mm.Subject = Subject.Text
mm.Body = Body.Text & TextBox1.Text
mm.IsBodyHtml = False
'(3) Create the SmtpClient object
Dim smtp As New Net.Mail.SmtpCl ient
'(4) Send the MailMessage (will use the Web.config settings)
smtp.Send(mm)
End Sub
</script>- Hide quoted text -
- Show quoted text -
I tried the response.write and I get a valid text string. When I try
to use Body.Text & Listbox1.Select edItem.text togethor I get the
following failure:

Exception Details: System.Net.Mail .SmtpException: Service not
available, closing transmission channel. The server response was:
Command timeout, closing transmission channel

It's almost as if the server is timing out.- Hide quoted text -

- Show quoted text -

Well....I guess I do not understand the Try/Catch. The page did not
error out, but the email was never sent as well.

Sep 22 '07 #9

<bg********@yah oo.comwrote in message
news:11******** *************@k 79g2000hse.goog legroups.com...
On Sep 22, 2:48 am, "ThatsIT.net.au " <me@thatsitwrot e:
>sorry did not read your post correctly

try writing

response.write (Body.Text & Listbox1.Select edItem.Text)

see what you get

<bgreer5...@ya hoo.comwrote in message

news:11******* *************** @w3g2000hsg.goo glegroups.com.. .


I have a form with the following fields:
UserEmail
Subject
Body
When the form is submitted, the email is processed fine. When I try
to add another field to the mm.body (mm.Body = Body.Text &
Listbox1.Select edItem.Text) the smtp.Send fails. Any ideas ?
Code:
<script runat="server">
Protected Sub SendEmail_Click (ByVal sender As Object, ByVal e As
System.EventArg s) Handles SendEmail.Click
'!!! UPDATE THIS VALUE TO YOUR EMAIL ADDRESS
Const ToAddress As String = "a...@abc.c om"
'(1) Create the MailMessage instance
Dim mm As New Net.Mail.MailMe ssage(UsersEmai l.Text, ToAddress)
'(2) Assign the MailMessage's properties
mm.Subject = Subject.Text
mm.Body = Body.Text & TextBox1.Text
mm.IsBodyHtml = False
'(3) Create the SmtpClient object
Dim smtp As New Net.Mail.SmtpCl ient
'(4) Send the MailMessage (will use the Web.config settings)
smtp.Send(mm)
End Sub
</script>- Hide quoted text -

- Show quoted text -

I tried the response.write and I get a valid text string. When I try
to use Body.Text & Listbox1.Select edItem.text togethor I get the
following failure:

Exception Details: System.Net.Mail .SmtpException: Service not
available, closing transmission channel. The server response was:
Command timeout, closing transmission channel

It's almost as if the server is timing out.

This error seems not to be related to your text string, but to do with smtp
not being available.
make sure you have smtp working and tell smtp client what computer it is on

Dim emailClient As New SmtpClient("Ema il Server Name")

Sep 23 '07 #10

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

Similar topics

2
2802
by: Dan Boyle | last post by:
Hi, I am having difficulty connection to an smtp host. I am using the following code but I don't think I fully understand what smtp host can be used. function setSMTPParams($host = null, $port = null, $helo = null, $auth = null, $user = null, $pass = null) { if (!is_null($host)) $this->smtp_params = $host;
34
18203
by: antonyliu2002 | last post by:
I've set up the virtual smtp server on my IIS 5.1 like so: 1. Assign IP address to "All Unassigned", and listen to port 25. 2. Access Connection granted to "127.0.0.1". 3. Relay only allow "127.0.0.1". 4. Authentication: "Anonymous access" only. 5. Outbound connection listen to TCP 25. Besides,
3
1697
by: piercy | last post by:
is there a way to verify a SMTP server? for instance. my users specify the SMTP server depending on there local settings. if they put in a wrong smtp address it will still attempt to send the email and wont display a fail. is there anyway to verify the server is a smtp server? or any other methods of verification i can take to check this?...
2
1855
by: Bgreer5050 | last post by:
I posted a problem with sending email via smtp using Dot Net 2.0 I was told to look at adding authentication to my web.config file; I added the following: authenticationMode="SSL" I put this in my web.config mail settings and when I put the mouse over it, i get the following message:
9
1274
by: Keith G Hicks | last post by:
I have a vb app that runs on a server. It periodically checks for rows in a table that are ready to have data mailed out to clients. After it finds row(s) that are ready, it emails the info out and then marks the rows as having been sent. It all works fine except for one thing. There have been a couple of times when the 2nd part chokes due to...
0
7839
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...
0
8338
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7954
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
8215
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
6610
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 project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3836
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
3864
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2345
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
1448
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.