Solved

Sending an Email From LocalHost

Posted on 2009-06-30
16
305 Views
Last Modified: 2012-05-07
Is there anyway to send a email from your application using localhost. I tried this, but doesnt work.
<system.net>
      <mailSettings>
        <smtp deliveryMethod="Network">
          <network host="localhost" port="25" />
        </smtp>
      </mailSettings>
    </system.net>

Open in new window

0
Comment
Question by:npl77
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 7
16 Comments
 
LVL 7

Expert Comment

by:urir10
ID: 24749110
0
 

Author Comment

by:npl77
ID: 24749445
I did that....
Im getting this exception
No connection could be made because the target machine actively refused it 127.0.0.1:25
0
 
LVL 12

Expert Comment

by:Hairbrush
ID: 24752787
Hi npl

If you've installed the SMTP service on your machine but it is not fully working then you could try following the steps listed on this site: http://thedaneshproject.com/posts/send-mail-through-smtp-using-telnet/

This will enable you to identify the specific problem that your SMTP service is having.
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

Author Comment

by:npl77
ID: 24755204
Where do I "key in" this stuff. Can you expand on exactly what to do in the steps from the url posted. I dont know what it means to...

Telnet to the server via port 25.    <------How do you do this?

1. Key in EHLO example.com and hit enter.        <------How do you do this?
0
 
LVL 12

Expert Comment

by:Hairbrush
ID: 24755670
Hi again

It would help to know what operating system is the server running on?

Basically you need to run TELNET from the command line, so you'd click Start->Run and enter CMD to bring up a command prompt, then you'd enter TELNET localhost 25

Assuming you have TELNET installed, you'll then connect to the service that is listening on the TCP/IP port 25 (which will be your SMTP server)
If however TELNET is not installed and you get an "unknown command or filename" type message, you'll need to first install it by going in to Control Panel and Add/Remove Programs (Programs and Features in Windows Server 2008 or Vista) and then "turn windows features on or off" and then add TELNET from the options you see there.
Basically TELNET lets you talk directly to the SMTP service without the nice GUI interface that a normal e-mail client would give you, and lets you type in raw email commands and see extactly what messages and errors your mail server is returning.
0
 

Author Comment

by:npl77
ID: 24758548
I am using my laptop Vista Home OS. I just installed TELENET but its saying it cannot open a connection on port 25
0
 

Author Comment

by:npl77
ID: 24758558
I download both the client and server for telenet
0
 
LVL 12

Expert Comment

by:Hairbrush
ID: 24761303
Do you have Windows Firewall enabled?  If so, you'll need to either disable it or to allow SMTP traffic to your SMTP server on port 25.

Please click Start->Control Panel->Windows Firewall.  Does it say that the firewall is on or off?

If it is on, click "Allow a program through Windows Firewall".  From the Exceptions tab, scroll down and you should see SMTP.  Check the box and click OK.  Then retry the TELNET test.
0
 

Author Comment

by:npl77
ID: 24767275
i do not have the windows firewall on and it still doesnt work
0
 
LVL 12

Expert Comment

by:Hairbrush
ID: 24767620
If it is saying that it cannot open a connection, it sounds like your SMTP server is not correctly installed.  Can you tell me the steps you took to install and configure the SMTP service?
0
 

Author Comment

by:npl77
ID: 24769469
Went to Windows features and checked TELNET client and TELNET server then they installed successfully and after that I got rid of the "unknown error" when typing TELNET localhost 25 in the command prompt. After that I made sure my firewall was off and it was.
0
 
LVL 12

Expert Comment

by:Hairbrush
ID: 24770626
No - that is how you installed the TELNET program.  How did you install the SMTP service (the mail server)??
0
 

Author Comment

by:npl77
ID: 24772879
I didnt maybe. How do you do it?
0
 
LVL 12

Accepted Solution

by:
Hairbrush earned 500 total points
ID: 24772988
Well, that turns out to be a bit of a trick question of mine, because it turns out that there is no SMTP service in Vista.  You will need to install one from a third-party.

You could try the free one at http://softstack.com/freesmtp.html

0
 
LVL 12

Expert Comment

by:Hairbrush
ID: 24773013
By the way, the reason I thought you had already installed an SMTP server when Uri sent you a link to instructions on how to install the SMTP server (on Windows Server) you replied "I did that...."
0
 

Author Comment

by:npl77
ID: 24773365
Ok I installed that and tried again still the same error. Do I have to do something besides simply installing the free SMTP?
0

Featured Post

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question