Solved

Sending an Email From LocalHost

Posted on 2009-06-30
16
290 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
  • 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Calling web service and its methods dynamically 2 57
Anyway to make "All" the default in the dropdown? 6 35
Not showing JavaScript in the list 5 52
Connection String 16 54
One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

785 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