Mail Server Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsSystem AdministrationMail Server Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 17th, 2010, 04:49 PM
ds92037 ds92037 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2010
Posts: 1 ds92037 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 12 sec
Reputation Power: 0
Some conceptual questions about how mail works

I have some conceptual questions about how mail works. I'm a web programmer w/ limited sysadmin experience. I've always taken for granted that the server I'm programming on is able to send out email. Typically, I use PHP's mail() function and it just works. Now I'm working on a server (Windows Server) that is not running an SMTP server, so I need to figure out how to send out mail.

Let's say my server is foo.bar.org and I work for bar.org, which has many servers. I want the webserver on foo to be able to send out email. I think that one way to do this is to get an email address from bar.org (which has an SMTP server running), and set up the webserver on foo to connect to that SMTP server to send out email. Will that work?

I think that another way to make this work is to run an SMTP server on foo, and have the webserver connect to it (i.e., on localhost). But then how does the SMTP server know which machine to connect to, to send and receive emails? Does it connect directly to the SMTP server named in the email's "To:" field? In other words, if the email is address to "bill@microsoft.com", will my SMTP server connect directly to port 25 on microsoft.com?

Thanks.

Reply With Quote
  #2  
Old June 17th, 2010, 05:07 PM
E-Oreo's Avatar
E-Oreo E-Oreo is offline
Lost in code
Click here for more information.
 
Join Date: Dec 2004
Posts: 7,931 E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 90th Grade (Above 100000 Reputation Level)  Folding Points: 945 Folding Title: Novice Folder
Time spent in forums: 2 Months 7 h 43 m 47 sec
Reputation Power: 6991
Quote:
set up the webserver on foo to connect to that SMTP server to send out email. Will that work?

Yes

Quote:
Does it connect directly to the SMTP server named in the email's "To:" field?

Sort of. It actually looks up the DNS records for the domains in the to field, identifies the MX records and then contacts one of the SMTP servers running on the addresses specified in the MX records.
__________________
PHP FAQ
How to program a basic, secure login system using PHP

Quote:
Originally Posted by Spad
Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around

Reply With Quote
  #3  
Old June 17th, 2010, 11:19 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 19th Plane (14000 - 14499 posts)
 
Join Date: Jun 2003
Posts: 14,233 Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 4 Weeks 14 h 15 m 56 sec
Reputation Power: 4445
If your windows server has IIS, most versions of IIS have an optional built-in SMTP server. If you have another mail server on the same LAN usually that works fine.

Using external smtp servers from server-side code can be problematic. The SMTP port is often blocked by admins or ISP's. The remote SMTP server may think you're a spammer and reject connections from your server.

But you can use external smtp servers, I use my ISP smtp server with local web code.
__________________
======
Doug G
======
It is a truism of American politics that no man who can win an election deserves to. --Trevanian, from the novel Shibumi

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationMail Server Help > Some conceptual questions about how mail works

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap