Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Sending Email From Page

Reply
Thread Tools

Sending Email From Page

 
 
John
Guest
Posts: n/a
 
      02-15-2007
Hi there,

I'm sure this is very basic for those who know..............but can anyone
tell what I'm doing wrong?

I'm trying out a 'send email from page' from a Wrox book and getting the
following error:

"No connection could be made because the target machine actively refused it
"

Basically I've got a textbox and a button and have place the following code
uder the click event:

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click

Dim message As New System.Net.Mail.MailMessage("(E-Mail Removed)",
"(E-Mail Removed)")

message.Subject = "An Email Message From the web"

message.Body = Me.TextBox1.Text

Dim smtp As New System.Net.Mail.SmtpClient("localhost")

smtp.Send(message)

End Sub

I'm developing this in VS 2005 Pro (nb not IIS).

Please help a beginner!

Best regards

John


 
Reply With Quote
 
 
 
 
Aidy
Guest
Posts: n/a
 
      02-15-2007
You are trying to connect to the SMTP service running on your local host.
If you don't have one running then it has nothing to connect to. Try
connecting to your ISP's SMTP server instead.

"John" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Hi there,
>
> I'm sure this is very basic for those who know..............but can anyone
> tell what I'm doing wrong?
>
> I'm trying out a 'send email from page' from a Wrox book and getting the
> following error:
>
> "No connection could be made because the target machine actively refused
> it "
>
> Basically I've got a textbox and a button and have place the following
> code uder the click event:
>
> Protected Sub Button1_Click(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles Button1.Click
>
> Dim message As New System.Net.Mail.MailMessage("(E-Mail Removed)",
> "(E-Mail Removed)")
>
> message.Subject = "An Email Message From the web"
>
> message.Body = Me.TextBox1.Text
>
> Dim smtp As New System.Net.Mail.SmtpClient("localhost")
>
> smtp.Send(message)
>
> End Sub
>
> I'm developing this in VS 2005 Pro (nb not IIS).
>
> Please help a beginner!
>
> Best regards
>
> John
>
>



 
Reply With Quote
 
 
 
 
Alexey Smirnov
Guest
Posts: n/a
 
      02-15-2007
On Feb 15, 1:39 pm, "John" <(E-Mail Removed)> wrote:
> Hi there,
>
> I'm sure this is very basic for those who know..............but can anyone
> tell what I'm doing wrong?
>
> I'm trying out a 'send email from page' from a Wrox book and getting the
> following error:
>
> "No connection could be made because the target machine actively refused it
> "
>
> Basically I've got a textbox and a button and have place the following code
> uder the click event:
>
> Protected Sub Button1_Click(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles Button1.Click
>
> Dim message As New System.Net.Mail.MailMessage("(E-Mail Removed)",
> "(E-Mail Removed)")
>
> message.Subject = "An Email Message From the web"
>
> message.Body = Me.TextBox1.Text
>
> Dim smtp As New System.Net.Mail.SmtpClient("localhost")
>
> smtp.Send(message)
>
> End Sub
>
> I'm developing this in VS 2005 Pro (nb not IIS).
>
> Please help a beginner!
>
> Best regards
>
> John


SMTP service is not started

 
Reply With Quote
 
John
Guest
Posts: n/a
 
      02-15-2007
Hello Aidy and Alexey,

Thanks for your replies. Well I've added my email smtp server details but
I'm now getting another error, which I assume is my isp blocking outgoing
email?

ERROR = "Transaction failed. The server response was:
<my.isp.server[my.isp.server.ip.address]>: Client host rejected: Access
denied"

Is there any way around this?

Thanks again.

John

"Aidy" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> You are trying to connect to the SMTP service running on your local host.
> If you don't have one running then it has nothing to connect to. Try
> connecting to your ISP's SMTP server instead.
>
> "John" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> Hi there,
>>
>> I'm sure this is very basic for those who know..............but can
>> anyone tell what I'm doing wrong?
>>
>> I'm trying out a 'send email from page' from a Wrox book and getting the
>> following error:
>>
>> "No connection could be made because the target machine actively refused
>> it "
>>
>> Basically I've got a textbox and a button and have place the following
>> code uder the click event:
>>
>> Protected Sub Button1_Click(ByVal sender As Object, ByVal e As
>> System.EventArgs) Handles Button1.Click
>>
>> Dim message As New System.Net.Mail.MailMessage("(E-Mail Removed)",
>> "(E-Mail Removed)")
>>
>> message.Subject = "An Email Message From the web"
>>
>> message.Body = Me.TextBox1.Text
>>
>> Dim smtp As New System.Net.Mail.SmtpClient("localhost")
>>
>> smtp.Send(message)
>>
>> End Sub
>>
>> I'm developing this in VS 2005 Pro (nb not IIS).
>>
>> Please help a beginner!
>>
>> Best regards
>>
>> John
>>
>>

>
>



 
Reply With Quote
 
sloan
Guest
Posts: n/a
 
      02-15-2007
I have several complete email samples at:

You need to know about none, basic, ssl authentication (in addition to all
the other email stuff you need to know)


http://sholliday.spaces.live.com/blog/

2/8/2006
Smarter Email/Smtp setup with DotNet Configuration Sections (1.1 and 2.0)



"John" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Hi there,
>
> I'm sure this is very basic for those who know..............but can anyone
> tell what I'm doing wrong?
>
> I'm trying out a 'send email from page' from a Wrox book and getting the
> following error:
>
> "No connection could be made because the target machine actively refused

it
> "
>
> Basically I've got a textbox and a button and have place the following

code
> uder the click event:
>
> Protected Sub Button1_Click(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles Button1.Click
>
> Dim message As New System.Net.Mail.MailMessage("(E-Mail Removed)",
> "(E-Mail Removed)")
>
> message.Subject = "An Email Message From the web"
>
> message.Body = Me.TextBox1.Text
>
> Dim smtp As New System.Net.Mail.SmtpClient("localhost")
>
> smtp.Send(message)
>
> End Sub
>
> I'm developing this in VS 2005 Pro (nb not IIS).
>
> Please help a beginner!
>
> Best regards
>
> John
>
>



 
Reply With Quote
 
bruce barker
Guest
Posts: n/a
 
      02-15-2007
you need to supply the proper credentials, also your isp may require
that the from match the account name. also set ssl if required.

-- bruce (sqlwork.com)

John wrote:
> Hello Aidy and Alexey,
>
> Thanks for your replies. Well I've added my email smtp server details but
> I'm now getting another error, which I assume is my isp blocking outgoing
> email?
>
> ERROR = "Transaction failed. The server response was:
> <my.isp.server[my.isp.server.ip.address]>: Client host rejected: Access
> denied"
>
> Is there any way around this?
>
> Thanks again.
>
> John
>
> "Aidy" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> You are trying to connect to the SMTP service running on your local host.
>> If you don't have one running then it has nothing to connect to. Try
>> connecting to your ISP's SMTP server instead.
>>
>> "John" <(E-Mail Removed)> wrote in message
>> news:%(E-Mail Removed)...
>>> Hi there,
>>>
>>> I'm sure this is very basic for those who know..............but can
>>> anyone tell what I'm doing wrong?
>>>
>>> I'm trying out a 'send email from page' from a Wrox book and getting the
>>> following error:
>>>
>>> "No connection could be made because the target machine actively refused
>>> it "
>>>
>>> Basically I've got a textbox and a button and have place the following
>>> code uder the click event:
>>>
>>> Protected Sub Button1_Click(ByVal sender As Object, ByVal e As
>>> System.EventArgs) Handles Button1.Click
>>>
>>> Dim message As New System.Net.Mail.MailMessage("(E-Mail Removed)",
>>> "(E-Mail Removed)")
>>>
>>> message.Subject = "An Email Message From the web"
>>>
>>> message.Body = Me.TextBox1.Text
>>>
>>> Dim smtp As New System.Net.Mail.SmtpClient("localhost")
>>>
>>> smtp.Send(message)
>>>
>>> End Sub
>>>
>>> I'm developing this in VS 2005 Pro (nb not IIS).
>>>
>>> Please help a beginner!
>>>
>>> Best regards
>>>
>>> John
>>>
>>>

>>

>
>

 
Reply With Quote
 
John
Guest
Posts: n/a
 
      02-15-2007
Thanks Bruce. I see Sloan has some examples so I might try and work through
those as I'm fairly new to this area.

Thanks again.

John

"bruce barker" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> you need to supply the proper credentials, also your isp may require that
> the from match the account name. also set ssl if required.
>
> -- bruce (sqlwork.com)
>
> John wrote:
>> Hello Aidy and Alexey,
>>
>> Thanks for your replies. Well I've added my email smtp server details
>> but I'm now getting another error, which I assume is my isp blocking
>> outgoing email?
>>
>> ERROR = "Transaction failed. The server response was:
>> <my.isp.server[my.isp.server.ip.address]>: Client host rejected: Access
>> denied"
>>
>> Is there any way around this?
>>
>> Thanks again.
>>
>> John
>>
>> "Aidy" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> You are trying to connect to the SMTP service running on your local
>>> host. If you don't have one running then it has nothing to connect to.
>>> Try connecting to your ISP's SMTP server instead.
>>>
>>> "John" <(E-Mail Removed)> wrote in message
>>> news:%(E-Mail Removed)...
>>>> Hi there,
>>>>
>>>> I'm sure this is very basic for those who know..............but can
>>>> anyone tell what I'm doing wrong?
>>>>
>>>> I'm trying out a 'send email from page' from a Wrox book and getting
>>>> the following error:
>>>>
>>>> "No connection could be made because the target machine actively
>>>> refused it "
>>>>
>>>> Basically I've got a textbox and a button and have place the following
>>>> code uder the click event:
>>>>
>>>> Protected Sub Button1_Click(ByVal sender As Object, ByVal e As
>>>> System.EventArgs) Handles Button1.Click
>>>>
>>>> Dim message As New System.Net.Mail.MailMessage("(E-Mail Removed)",
>>>> "(E-Mail Removed)")
>>>>
>>>> message.Subject = "An Email Message From the web"
>>>>
>>>> message.Body = Me.TextBox1.Text
>>>>
>>>> Dim smtp As New System.Net.Mail.SmtpClient("localhost")
>>>>
>>>> smtp.Send(message)
>>>>
>>>> End Sub
>>>>
>>>> I'm developing this in VS 2005 Pro (nb not IIS).
>>>>
>>>> Please help a beginner!
>>>>
>>>> Best regards
>>>>
>>>> John
>>>>
>>>>
>>>

>>


 
Reply With Quote
 
John
Guest
Posts: n/a
 
      02-15-2007
Hi Sloan,

Thanks for your reply. I've had a look at your blog and will have a go with
your example. Great blog!

Thanks again.

John

"sloan" <(E-Mail Removed)> wrote in message
news:%23jKbF$(E-Mail Removed)...
>I have several complete email samples at:
>
> You need to know about none, basic, ssl authentication (in addition to all
> the other email stuff you need to know)
>
>
> http://sholliday.spaces.live.com/blog/
>
> 2/8/2006
> Smarter Email/Smtp setup with DotNet Configuration Sections (1.1 and 2.0)
>
>
>
> "John" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> Hi there,
>>
>> I'm sure this is very basic for those who know..............but can
>> anyone
>> tell what I'm doing wrong?
>>
>> I'm trying out a 'send email from page' from a Wrox book and getting the
>> following error:
>>
>> "No connection could be made because the target machine actively refused

> it
>> "
>>
>> Basically I've got a textbox and a button and have place the following

> code
>> uder the click event:
>>
>> Protected Sub Button1_Click(ByVal sender As Object, ByVal e As
>> System.EventArgs) Handles Button1.Click
>>
>> Dim message As New System.Net.Mail.MailMessage("(E-Mail Removed)",
>> "(E-Mail Removed)")
>>
>> message.Subject = "An Email Message From the web"
>>
>> message.Body = Me.TextBox1.Text
>>
>> Dim smtp As New System.Net.Mail.SmtpClient("localhost")
>>
>> smtp.Send(message)
>>
>> End Sub
>>
>> I'm developing this in VS 2005 Pro (nb not IIS).
>>
>> Please help a beginner!
>>
>> Best regards
>>
>> John
>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to get the correct email format when sending email using sqldatareader rote ASP .Net 8 04-17-2008 02:14 AM
problem sending mail: Sending the email to the following server failed Luke Java 2 03-15-2007 10:54 AM
Sending email from a web page? John ASP .Net 0 10-21-2004 12:39 AM
Problem sending email through asp.net page (only certain addresses) VB Programmer ASP .Net 3 08-09-2004 08:35 PM
Problem with sending email from asp.net page using smtp bivin ASP .Net 1 06-27-2003 09:15 AM



Advertisments