473,662 Members | 2,631 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sending Email From Page

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(B yVal sender As Object, ByVal e As
System.EventArg s) Handles Button1.Click

Dim message As New System.Net.Mail .MailMessage("a n@email.com",
"an@email.c om")

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

message.Body = Me.TextBox1.Tex t

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

smtp.Send(messa ge)

End Sub

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

Please help a beginner!

Best regards

John
Feb 15 '07 #1
7 4120
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" <Jo************ @AOL.netwrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
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(B yVal sender As Object, ByVal e As
System.EventArg s) Handles Button1.Click

Dim message As New System.Net.Mail .MailMessage("a n@email.com",
"an@email.c om")

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

message.Body = Me.TextBox1.Tex t

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

smtp.Send(messa ge)

End Sub

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

Please help a beginner!

Best regards

John


Feb 15 '07 #2
On Feb 15, 1:39 pm, "John" <JohnSickOfS... @AOL.netwrote:
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(B yVal sender As Object, ByVal e As
System.EventArg s) Handles Button1.Click

Dim message As New System.Net.Mail .MailMessage("a ...@email.com",
"a...@email.com ")

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

message.Body = Me.TextBox1.Tex t

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

smtp.Send(messa ge)

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

Feb 15 '07 #3
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 = "Transactio n failed. The server response was:
<my.isp.serve r[my.isp.server.i p.address]>: Client host rejected: Access
denied"

Is there any way around this?

Thanks again.

John

"Aidy" <ai**@noemail.x xxa.comwrote in message
news:2K******** *************** *******@bt.com. ..
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" <Jo************ @AOL.netwrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
>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(B yVal sender As Object, ByVal e As
System.EventAr gs) Handles Button1.Click

Dim message As New System.Net.Mail .MailMessage("a n@email.com",
"an@email.com" )

message.Subjec t = "An Email Message From the web"

message.Body = Me.TextBox1.Tex t

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

smtp.Send(mess age)

End Sub

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

Please help a beginner!

Best regards

John



Feb 15 '07 #4
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" <Jo************ @AOL.netwrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
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(B yVal sender As Object, ByVal e As
System.EventArg s) Handles Button1.Click

Dim message As New System.Net.Mail .MailMessage("a n@email.com",
"an@email.c om")

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

message.Body = Me.TextBox1.Tex t

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

smtp.Send(messa ge)

End Sub

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

Please help a beginner!

Best regards

John


Feb 15 '07 #5
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 = "Transactio n failed. The server response was:
<my.isp.serve r[my.isp.server.i p.address]>: Client host rejected: Access
denied"

Is there any way around this?

Thanks again.

John

"Aidy" <ai**@noemail.x xxa.comwrote in message
news:2K******** *************** *******@bt.com. ..
>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" <Jo************ @AOL.netwrote in message
news:%2******* *********@TK2MS FTNGP03.phx.gbl ...
>>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(B yVal sender As Object, ByVal e As
System.EventA rgs) Handles Button1.Click

Dim message As New System.Net.Mail .MailMessage("a n@email.com",
"an@email.com ")

message.Subje ct = "An Email Message From the web"

message.Bod y = Me.TextBox1.Tex t

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

smtp.Send(mes sage)

End Sub

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

Please help a beginner!

Best regards

John


Feb 15 '07 #6
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" <no****@nospam. comwrote in message
news:eC******** ******@TK2MSFTN GP03.phx.gbl...
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 = "Transactio n failed. The server response was:
<my.isp.serv er[my.isp.server.i p.address]>: Client host rejected: Access
denied"

Is there any way around this?

Thanks again.

John

"Aidy" <ai**@noemail.x xxa.comwrote in message
news:2K******* *************** ********@bt.com ...
>>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" <Jo************ @AOL.netwrote in message
news:%2****** **********@TK2M SFTNGP03.phx.gb l...
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(B yVal sender As Object, ByVal e As
System.Event Args) Handles Button1.Click

Dim message As New System.Net.Mail .MailMessage("a n@email.com",
"an@email.co m")

message.Subj ect = "An Email Message From the web"

message.Bo dy = Me.TextBox1.Tex t

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

smtp.Send(me ssage)

End Sub

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

Please help a beginner!

Best regards

John
Feb 15 '07 #7
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" <sl***@ipass.ne twrote in message
news:%2******** ********@TK2MSF TNGP06.phx.gbl. ..
>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" <Jo************ @AOL.netwrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
>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(B yVal sender As Object, ByVal e As
System.EventAr gs) Handles Button1.Click

Dim message As New System.Net.Mail .MailMessage("a n@email.com",
"an@email.com" )

message.Subjec t = "An Email Message From the web"

message.Body = Me.TextBox1.Tex t

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

smtp.Send(mess age)

End Sub

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

Please help a beginner!

Best regards

John



Feb 15 '07 #8

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

Similar topics

2
1907
by: Joe | last post by:
Hi, I am sending an email from an asp page. Besides sending an email to sender, I am sending myself a BCC also. Out of 100 emails sent, about 5 recipients received a blank email (no text in subject and body). The BCC of all these emails that I sent to myself were fine. When I send email manually to these 5 recipients they receive it well. I have pasted my code below. Can someone give me a clue as why this could be happening? Is...
1
2761
by: festivalman | last post by:
Hi, sorry if this is in the wrong spot. Finding the newsgroups on MS's site could have been easier Here's my problem I've got some old asp's that are running our simple web site. In a section, there's a contact for that collects a few lines of info, and when you hit submit, it takes that and sends it to a specifie email address. It's been working all this time, but recently we just bought and implemented exchange 2003 on the server and...
3
6820
by: VB Programmer | last post by:
I have an ASPX page where I send out emails through my mail server mail.MyDomain.com. When I send emails to MyName@MyDomain.com it sends PERFECTLY. When I try sending an email to any other address (non-MyDomain.com address) I get the following error: The server rejected one or more recipient addresses. The server response was: 550 You must check your mail from this IP or SMTP Auth before sending to BSmith@Juno.com Here's the FULL...
6
2409
by: Eduardo Rosa | last post by:
Somebody knows how I queue email using .Net? thanks a lot
1
8175
by: Eric Sheu | last post by:
Greetings, I have been searching the web like mad for a solution to my SMTP problem. I am using Windows Server 2003 and ASP.NET 2.0 w/ C# to send out e-mails from a web site I have created to the members of my organization. I think my problem is incorrectly setting the settings on my server or an authentication problem. Here is the code I have written to send a test message: -----Code Begins: Sensitive Information Replaced by -----...
4
5043
by: Roger Withnell | last post by:
I'm sending Russian text in an email generated from the website which displays in the email as ?????????? The website is set to codepage 65001 and the charset to utf-8. Please advise. Posted Via Usenet.com Premium Usenet Newsgroup Services
3
4271
by: armando perez | last post by:
Hi, this is my first time here, but I was looking for something that may help me, and still, I haven't found something to use. I'm using a website made in .NET with C#, when I'm running my site from my PC, everything seems right, but when I publish the website, and send it to my real website, everything works but the mail sending. I have red some groups and topics, and everywhere I can found: - Use the following syntax: <system.net>
8
3803
by: Marty | last post by:
I'm having issues sending an email to an "@page.nextel.com" email address. I can send to any other email address fine, but when I try the page.nextel.com it gives me this error: Final-Recipient: XXXXXXX@page.nextel.com Diagnostic-Code: smtp; 554 message body contains illegal bare CR/LF characters. Action: failed Status: 5.0.0
8
2908
by: nargis2009 | last post by:
Hi, I have been encountering problems with my web page which is supposed to send email, and wondered if anybody can help find error. Initially I had all codes in one page and on click of Submit it would send email. But then I wanted to give a user an opportunity to go back and edit the entries if incorrect before submitting. I separted the codes into two pages. On the second page when Submit button is clicked it should send email. But...
1
1791
by: runway27 | last post by:
<?php $headers = "Content-type: text/html; charset=iso-8859-1"; $to="myemailaddress"; $subject="Email Newsletter"; $message = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Email Newsletter</title>
0
8345
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8857
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8547
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
7368
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6186
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5655
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4348
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2763
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
2
1999
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.