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.SelectedItem.Text) the smtp.Send fails. Any ideas ?
Code:
<script runat="server">
Protected Sub SendEmail_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles SendEmail.Click
'!!! UPDATE THIS VALUE TO YOUR EMAIL ADDRESS
Const ToAddress As String = "abc@dotnet.itags.org.abc.com"
'(1) Create the MailMessage instance
Dim mm As New Net.Mail.MailMessage(UsersEmail.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.SmtpClient
'(4) Send the MailMessage (will use the Web.config settings)
smtp.Send(mm)
End Sub
</script>Does the server have smtp
if not you need to tell smtpclient where to find one
Dim message As New MailMessage("sender@dotnet.itags.org.address", "from@dotnet.itags.org.address", "Subject",
"Message Text")
Dim emailClient As New SmtpClient("Email Server Name")
emailClient.Send(message)
<bgreer5050@dotnet.itags.org.yahoo.comwrote in message
news:1190444991.855340.184730@dotnet.itags.org.w3g2000hsg.googlegro ups.com...
Quote:
Originally Posted by
>
>
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.SelectedItem.Text) the smtp.Send fails. Any ideas ?
>
>
Code:
>
<script runat="server">
Protected Sub SendEmail_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles SendEmail.Click
'!!! UPDATE THIS VALUE TO YOUR EMAIL ADDRESS
Const ToAddress As String = "abc@dotnet.itags.org.abc.com"
>
'(1) Create the MailMessage instance
Dim mm As New Net.Mail.MailMessage(UsersEmail.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.SmtpClient
>
'(4) Send the MailMessage (will use the Web.config settings)
smtp.Send(mm)
End Sub
>
>
</script>
>
sorry did not read your post correctly
try writing
response.write(Body.Text & Listbox1.SelectedItem.Text)
see what you get
<bgreer5050@dotnet.itags.org.yahoo.comwrote in message
news:1190444991.855340.184730@dotnet.itags.org.w3g2000hsg.googlegro ups.com...
Quote:
Originally Posted by
>
>
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.SelectedItem.Text) the smtp.Send fails. Any ideas ?
>
>
Code:
>
<script runat="server">
Protected Sub SendEmail_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles SendEmail.Click
'!!! UPDATE THIS VALUE TO YOUR EMAIL ADDRESS
Const ToAddress As String = "abc@dotnet.itags.org.abc.com"
>
'(1) Create the MailMessage instance
Dim mm As New Net.Mail.MailMessage(UsersEmail.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.SmtpClient
>
'(4) Send the MailMessage (will use the Web.config settings)
smtp.Send(mm)
End Sub
>
>
</script>
>
Also....
Put a try/catch block around the code and see what that kicks up if anything
"ThatsIT.net.au" <me@dotnet.itags.org.thatsitwrote in message
news:14418196-C68F-43AA-86E5-29489860C2A4@dotnet.itags.org.microsoft.com...
Quote:
Originally Posted by
Does the server have smtp
>
if not you need to tell smtpclient where to find one
>
Dim message As New MailMessage("sender@dotnet.itags.org.address", "from@dotnet.itags.org.address",
"Subject", "Message Text")
>
Dim emailClient As New SmtpClient("Email Server Name")
>
emailClient.Send(message)
>
>
>
<bgreer5050@dotnet.itags.org.yahoo.comwrote in message
news:1190444991.855340.184730@dotnet.itags.org.w3g2000hsg.googlegro ups.com...
Quote:
Originally Posted by
>>
>>
>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.SelectedItem.Text) the smtp.Send fails. Any ideas ?
>>
>>
>Code:
>>
><script runat="server">
> Protected Sub SendEmail_Click(ByVal sender As Object, ByVal e As
>System.EventArgs) Handles SendEmail.Click
> '!!! UPDATE THIS VALUE TO YOUR EMAIL ADDRESS
> Const ToAddress As String = "abc@dotnet.itags.org.abc.com"
>>
> '(1) Create the MailMessage instance
> Dim mm As New Net.Mail.MailMessage(UsersEmail.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.SmtpClient
>>
> '(4) Send the MailMessage (will use the Web.config settings)
> smtp.Send(mm)
> End Sub
>>
>>
></script>
>>
>
On Sep 22, 2:48 am, "ThatsIT.net.au" <me@dotnet.itags.org.thatsitwrote:
Quote:
Originally Posted by
sorry did not read your post correctly
>
try writing
>
response.write(Body.Text & Listbox1.SelectedItem.Text)
>
see what you get
>
<bgreer5...@dotnet.itags.org.yahoo.comwrote in message
>
news:1190444991.855340.184730@dotnet.itags.org.w3g2000hsg.googlegro ups.com...
>
>
>
>
>
Quote:
Originally Posted by
I have a form with the following fields:
>
Quote:
Originally Posted by
UserEmail
Subject
Body
>
Quote:
Originally Posted by
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.SelectedItem.Text) the smtp.Send fails. Any ideas ?
>
Quote:
Originally Posted by
Code:
>
Quote:
Originally Posted by
<script runat="server">
Protected Sub SendEmail_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles SendEmail.Click
'!!! UPDATE THIS VALUE TO YOUR EMAIL ADDRESS
Const ToAddress As String = "a...@dotnet.itags.org.abc.com"
>
Quote:
Originally Posted by
'(1) Create the MailMessage instance
Dim mm As New Net.Mail.MailMessage(UsersEmail.Text, ToAddress)
>
Quote:
Originally Posted by
'(2) Assign the MailMessage's properties
mm.Subject = Subject.Text
mm.Body = Body.Text & TextBox1.Text
mm.IsBodyHtml = False
>
Quote:
Originally Posted by
'(3) Create the SmtpClient object
Dim smtp As New Net.Mail.SmtpClient
>
Quote:
Originally Posted by
'(4) Send the MailMessage (will use the Web.config settings)
smtp.Send(mm)
End Sub
>
Quote:
Originally Posted by
</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.SelectedItem.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.
On Sep 22, 2:50 am, "Just Me" <news.microsoft.comwrote:
Quote:
Originally Posted by
Also....
>
Put a try/catch block around the code and see what that kicks up if anything
>
"ThatsIT.net.au" <me@dotnet.itags.org.thatsitwrote in message
>
news:14418196-C68F-43AA-86E5-29489860C2A4@dotnet.itags.org.microsoft.com...
>
>
>
Quote:
Originally Posted by
Does the server have smtp
>
Quote:
Originally Posted by
if not you need to tell smtpclient where to find one
>
Quote:
Originally Posted by
Dim message As New MailMessage("sender@dotnet.itags.org.address", "from@dotnet.itags.org.address",
"Subject", "Message Text")
>
Quote:
Originally Posted by
Dim emailClient As New SmtpClient("Email Server Name")
>
Quote:
Originally Posted by
emailClient.Send(message)
>
Quote:
Originally Posted by
<bgreer5...@dotnet.itags.org.yahoo.comwrote in message
news:1190444991.855340.184730@dotnet.itags.org.w3g2000hsg.googlegro ups.com...
>
Quote:
Originally Posted by
Quote:
Originally Posted by
I have a form with the following fields:
>
Quote:
Originally Posted by
Quote:
Originally Posted by
UserEmail
Subject
Body
>
Quote:
Originally Posted by
Quote:
Originally Posted by
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.SelectedItem.Text) the smtp.Send fails. Any ideas ?
>
Quote:
Originally Posted by
Quote:
Originally Posted by
Code:
>
Quote:
Originally Posted by
Quote:
Originally Posted by
<script runat="server">
Protected Sub SendEmail_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles SendEmail.Click
'!!! UPDATE THIS VALUE TO YOUR EMAIL ADDRESS
Const ToAddress As String = "a...@dotnet.itags.org.abc.com"
>
Quote:
Originally Posted by
Quote:
Originally Posted by
'(1) Create the MailMessage instance
Dim mm As New Net.Mail.MailMessage(UsersEmail.Text, ToAddress)
>
Quote:
Originally Posted by
Quote:
Originally Posted by
'(2) Assign the MailMessage's properties
mm.Subject = Subject.Text
mm.Body = Body.Text & TextBox1.Text
mm.IsBodyHtml = False
>
Quote:
Originally Posted by
Quote:
Originally Posted by
'(3) Create the SmtpClient object
Dim smtp As New Net.Mail.SmtpClient
>
Quote:
Originally Posted by
Quote:
Originally Posted by
'(4) Send the MailMessage (will use the Web.config settings)
smtp.Send(mm)
End Sub
>
Quote:
Originally Posted by
Quote:
Originally Posted by
</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?
On Sep 22, 3:15 am, "bgreer5...@dotnet.itags.org.yahoo.com" <bgreer5...@dotnet.itags.org.yahoo.com>
wrote:
Quote:
Originally Posted by
On Sep 22, 2:48 am, "ThatsIT.net.au" <me@dotnet.itags.org.thatsitwrote:
>
>
>
>
>
Quote:
Originally Posted by
sorry did not read your post correctly
>
Quote:
Originally Posted by
try writing
>
Quote:
Originally Posted by
response.write(Body.Text & Listbox1.SelectedItem.Text)
>
Quote:
Originally Posted by
see what you get
>
Quote:
Originally Posted by
<bgreer5...@dotnet.itags.org.yahoo.comwrote in message
>
Quote:
Originally Posted by
news:1190444991.855340.184730@dotnet.itags.org.w3g2000hsg.googlegro ups.com...
>
Quote:
Originally Posted by
Quote:
Originally Posted by
I have a form with the following fields:
>
Quote:
Originally Posted by
Quote:
Originally Posted by
UserEmail
Subject
Body
>
Quote:
Originally Posted by
Quote:
Originally Posted by
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.SelectedItem.Text) the smtp.Send fails. Any ideas ?
>
Quote:
Originally Posted by
Quote:
Originally Posted by
Code:
>
Quote:
Originally Posted by
Quote:
Originally Posted by
<script runat="server">
Protected Sub SendEmail_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles SendEmail.Click
'!!! UPDATE THIS VALUE TO YOUR EMAIL ADDRESS
Const ToAddress As String = "a...@dotnet.itags.org.abc.com"
>
Quote:
Originally Posted by
Quote:
Originally Posted by
'(1) Create the MailMessage instance
Dim mm As New Net.Mail.MailMessage(UsersEmail.Text, ToAddress)
>
Quote:
Originally Posted by
Quote:
Originally Posted by
'(2) Assign the MailMessage's properties
mm.Subject = Subject.Text
mm.Body = Body.Text & TextBox1.Text
mm.IsBodyHtml = False
>
Quote:
Originally Posted by
Quote:
Originally Posted by
'(3) Create the SmtpClient object
Dim smtp As New Net.Mail.SmtpClient
>
Quote:
Originally Posted by
Quote:
Originally Posted by
'(4) Send the MailMessage (will use the Web.config settings)
smtp.Send(mm)
End Sub
>
Quote:
Originally Posted by
Quote:
Originally Posted by
</script>- Hide quoted text -
>
Quote:
Originally Posted by
- Show quoted text -
>
I tried the response.write and I get a valid text string. When I try
to use Body.Text & Listbox1.SelectedItem.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.
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
<bgreer5050@dotnet.itags.org.yahoo.comwrote in message
news:1190449547.729012.49080@dotnet.itags.org.g4g2000hsf.googlegrou ps.com...
Quote:
Originally Posted by
On Sep 22, 3:15 am, "bgreer5...@dotnet.itags.org.yahoo.com" <bgreer5...@dotnet.itags.org.yahoo.com>
wrote:
Quote:
Originally Posted by
>On Sep 22, 2:48 am, "ThatsIT.net.au" <me@dotnet.itags.org.thatsitwrote:
>>
>>
>>
>>
>>
Quote:
Originally Posted by
sorry did not read your post correctly
>>
Quote:
Originally Posted by
try writing
>>
Quote:
Originally Posted by
response.write(Body.Text & Listbox1.SelectedItem.Text)
>>
Quote:
Originally Posted by
see what you get
>>
Quote:
Originally Posted by
<bgreer5...@dotnet.itags.org.yahoo.comwrote in message
>>
Quote:
Originally Posted by
>news:1190444991.855340.184730@dotnet.itags.org.w3g2000hsg.googlegro ups.com...
>>
Quote:
Originally Posted by
I have a form with the following fields:
>>
Quote:
Originally Posted by
UserEmail
Subject
Body
>>
Quote:
Originally Posted by
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.SelectedItem.Text) the smtp.Send fails. Any ideas ?
>>
Quote:
Originally Posted by
Code:
>>
Quote:
Originally Posted by
<script runat="server">
Protected Sub SendEmail_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles SendEmail.Click
'!!! UPDATE THIS VALUE TO YOUR EMAIL ADDRESS
Const ToAddress As String = "a...@dotnet.itags.org.abc.com"
>>
Quote:
Originally Posted by
'(1) Create the MailMessage instance
Dim mm As New Net.Mail.MailMessage(UsersEmail.Text, ToAddress)
>>
Quote:
Originally Posted by
'(2) Assign the MailMessage's properties
mm.Subject = Subject.Text
mm.Body = Body.Text & TextBox1.Text
mm.IsBodyHtml = False
>>
Quote:
Originally Posted by
'(3) Create the SmtpClient object
Dim smtp As New Net.Mail.SmtpClient
>>
Quote:
Originally Posted by
'(4) Send the MailMessage (will use the Web.config settings)
smtp.Send(mm)
End Sub
>>
Quote:
Originally Posted by
</script>- Hide quoted text -
>>
Quote:
Originally Posted by
- Show quoted text -
>>
>I tried the response.write and I get a valid text string. When I try
>to use Body.Text & Listbox1.SelectedItem.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.
>
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/2.../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/ArticleBl...MTP&PageIndex=0
Good luck
Braulio
/// ----------
/// Braulio Diez
///
/// http://www.tipsdotnet.com
/// ----------
"bgreer5050@dotnet.itags.org.yahoo.com" wrote:
Quote:
Originally Posted by
On Sep 22, 3:15 am, "bgreer5...@dotnet.itags.org.yahoo.com" <bgreer5...@dotnet.itags.org.yahoo.com>
wrote:
Quote:
Originally Posted by
On Sep 22, 2:48 am, "ThatsIT.net.au" <me@dotnet.itags.org.thatsitwrote:
Quote:
Originally Posted by
sorry did not read your post correctly
Quote:
Originally Posted by
try writing
Quote:
Originally Posted by
response.write(Body.Text & Listbox1.SelectedItem.Text)
Quote:
Originally Posted by
see what you get
Quote:
Originally Posted by
<bgreer5...@dotnet.itags.org.yahoo.comwrote in message
Quote:
Originally Posted by
>news:1190444991.855340.184730@dotnet.itags.org.w3g2000hsg.googlegro ups.com...
Quote:
Originally Posted by
I have a form with the following fields:
Quote:
Originally Posted by
UserEmail
Subject
Body
Quote:
Originally Posted by
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.SelectedItem.Text) the smtp.Send fails. Any ideas ?
Quote:
Originally Posted by
Code:
Quote:
Originally Posted by
<script runat="server">
Protected Sub SendEmail_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles SendEmail.Click
'!!! UPDATE THIS VALUE TO YOUR EMAIL ADDRESS
Const ToAddress As String = "a...@dotnet.itags.org.abc.com"
Quote:
Originally Posted by
'(1) Create the MailMessage instance
Dim mm As New Net.Mail.MailMessage(UsersEmail.Text, ToAddress)
Quote:
Originally Posted by
'(2) Assign the MailMessage's properties
mm.Subject = Subject.Text
mm.Body = Body.Text & TextBox1.Text
mm.IsBodyHtml = False
Quote:
Originally Posted by
'(3) Create the SmtpClient object
Dim smtp As New Net.Mail.SmtpClient
Quote:
Originally Posted by
'(4) Send the MailMessage (will use the Web.config settings)
smtp.Send(mm)
End Sub
Quote:
Originally Posted by
</script>- Hide quoted text -
Quote:
Originally Posted by
- Show quoted text -
I tried the response.write and I get a valid text string. When I try
to use Body.Text & Listbox1.SelectedItem.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.
>
>
<bgreer5050@dotnet.itags.org.yahoo.comwrote in message
news:1190448914.758793.92210@dotnet.itags.org.k79g2000hse.googlegro ups.com...
Quote:
Originally Posted by
On Sep 22, 2:48 am, "ThatsIT.net.au" <me@dotnet.itags.org.thatsitwrote:
Quote:
Originally Posted by
>sorry did not read your post correctly
>>
>try writing
>>
>response.write(Body.Text & Listbox1.SelectedItem.Text)
>>
>see what you get
>>
><bgreer5...@dotnet.itags.org.yahoo.comwrote in message
>>
>news:1190444991.855340.184730@dotnet.itags.org.w3g2000hsg.googlegro ups.com...
>>
>>
>>
>>
>>
Quote:
Originally Posted by
I have a form with the following fields:
>>
Quote:
Originally Posted by
UserEmail
Subject
Body
>>
Quote:
Originally Posted by
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.SelectedItem.Text) the smtp.Send fails. Any ideas ?
>>
Quote:
Originally Posted by
Code:
>>
Quote:
Originally Posted by
<script runat="server">
Protected Sub SendEmail_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles SendEmail.Click
'!!! UPDATE THIS VALUE TO YOUR EMAIL ADDRESS
Const ToAddress As String = "a...@dotnet.itags.org.abc.com"
>>
Quote:
Originally Posted by
'(1) Create the MailMessage instance
Dim mm As New Net.Mail.MailMessage(UsersEmail.Text, ToAddress)
>>
Quote:
Originally Posted by
'(2) Assign the MailMessage's properties
mm.Subject = Subject.Text
mm.Body = Body.Text & TextBox1.Text
mm.IsBodyHtml = False
>>
Quote:
Originally Posted by
'(3) Create the SmtpClient object
Dim smtp As New Net.Mail.SmtpClient
>>
Quote:
Originally Posted by
'(4) Send the MailMessage (will use the Web.config settings)
smtp.Send(mm)
End Sub
>>
Quote:
Originally Posted by
</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.SelectedItem.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("Email Server Name")
Thank you very much. The SMTP server I use is on a remote system. Is
there a way to use the "telnet localhost smtp" command with my remote
smtp proivider?
The smtp server is smtp.infosaic.com.
Thanks
P.S. Nice Blog
it would be
telnet hostname or ip 25
then begin the smtp protocol
<bgreer5050@dotnet.itags.org.yahoo.comwrote in message
news:1190644353.060705.18990@dotnet.itags.org.o80g2000hse.googlegro ups.com...
Quote:
Originally Posted by
>
>
Thank you very much. The SMTP server I use is on a remote system. Is
there a way to use the "telnet localhost smtp" command with my remote
smtp proivider?
>
The smtp server is smtp.infosaic.com.
>
Thanks
>
P.S. Nice Blog
>
Hello,
Yes, this links is an step by step guide to check if your remote SMTP is
working (using telnet):
http://msexchangeteam.com/archive/2.../14/428324.aspx
good luck
Braulio
/// ----------
/// Braulio Diez
///
/// http://www.tipsdotnet.com
/// ----------
"bgreer5050@dotnet.itags.org.yahoo.com" wrote:
Quote:
Originally Posted by
>
>
Thank you very much. The SMTP server I use is on a remote system. Is
there a way to use the "telnet localhost smtp" command with my remote
smtp proivider?
>
The smtp server is smtp.infosaic.com.
>
Thanks
>
P.S. Nice Blog
>
>
Is there suppose to be a command in the code to tell the smtp service,
that you are finished using it?
http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!138.entry
I have downloadable examples there.
See if you can get that to work, then work backwards from the example.
There are 3 different authentication modes for smtp. Maybe that's your
issue.
Look at the sample code to see what I mean by authentication modes.
<bgreer5050@dotnet.itags.org.yahoo.comwrote in message
news:1190444991.855340.184730@dotnet.itags.org.w3g2000hsg.googlegro ups.com...
Quote:
Originally Posted by
>
>
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.SelectedItem.Text) the smtp.Send fails. Any ideas ?
>
>
Code:
>
<script runat="server">
Protected Sub SendEmail_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles SendEmail.Click
'!!! UPDATE THIS VALUE TO YOUR EMAIL ADDRESS
Const ToAddress As String = "abc@dotnet.itags.org.abc.com"
>
'(1) Create the MailMessage instance
Dim mm As New Net.Mail.MailMessage(UsersEmail.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.SmtpClient
>
'(4) Send the MailMessage (will use the Web.config settings)
smtp.Send(mm)
End Sub
>
>
</script>
>
I checked out your samples. I am having a problem with:
authenicationMode="SSL"
I put this in my web.config mail settings and when I put the mouse
over it, i get the following message:
"The authenticationMode attribute is not declared"
Can you please help?
You are trying to mix my custom solution with the "out of the box"
configuration setup.
<bgreer5050@dotnet.itags.org.gmail.comwrote in message
news:1190915450.146480.160850@dotnet.itags.org.19g2000hsx.googlegro ups.com...
Quote:
Originally Posted by
>I checked out your samples. I am having a problem with:
>
authenicationMode="SSL"
>
I put this in my web.config mail settings and when I put the mouse
over it, i get the following message:
>
"The authenticationMode attribute is not declared"
>
Can you please help?
>
0 comments:
Post a Comment