473,406 Members | 2,956 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

what is the 'host' for SMTP?

If I want to write a cgi script that reads the contents of an HTML form
and emails it to me, what would I use as the host parameter for my SMTP
instance? The example in the docs is 'localhost', but I don't know what
that means or refers to. I imagine I would have to use something that
was tied to me specifically, but tied to what? My computer? My email
address?
May 3 '06 #1
6 2082
On Tue, 02 May 2006 22:12:31 -0400, John Salerno wrote:
If I want to write a cgi script that reads the contents of an HTML form
and emails it to me, what would I use as the host parameter for my SMTP
instance?
Take a look at your email client. Find where it specifies the server for
outgoing mail. Use whatever it says there.

For example, I am a customer of blarg.net; I am therefore permitted to use
mail.blarg.net, which has a mail server running on it. If your ISP is
example.com, you probably will be using one of these:

mail.example.com
smtp.example.com

But it really could be anything:

norwegianblue.example.com
lovelyplumage.example.com

The example in the docs is 'localhost', but I don't know what
that means or refers to.
"localhost" is a standard UNIX/Linux alias for "my computer's address".
It will be bound to 127.0.0.1, which is a special, magic address that
can stand in for your computer's actual address.

(Thus the old joke about "hey, try to hack my firewall! Here's the
address: 127.0.0.1

If someone runs an attack script against that address, they are attacking
their own computer.)

If you have an SMTP server running on your computer, then you could use
"localhost" and it will work. Otherwise, not.

I imagine I would have to use something that
was tied to me specifically, but tied to what? My computer? My email
address?


SMTP is a protocol. You can talk SMTP to any computer that has an SMTP
server running. The standard port number for SMTP is port 25.

These days, most SMTP servers won't just let anyone use them to send email
just anywhere; an SMTP server configured to allow that is called an "open
relay" and spammers love to find them.

If you are using email, then as I said above, your email client should
have an SMTP server filled in already, and you are already using it every
time you send email. So I suggest you use that.
--
Steve R. Hastings "Vita est"
st***@hastings.org http://www.blarg.net/~steveha

May 3 '06 #2
raj
If you've a gmail account, you can set it as smtp.gmail.com.

May 3 '06 #3
Steve R. Hastings wrote:
Take a look at your email client. Find where it specifies the server for
outgoing mail. Use whatever it says there.

For example, I am a customer of blarg.net; I am therefore permitted to use
mail.blarg.net, which has a mail server running on it. If your ISP is
example.com, you probably will be using one of these:

mail.example.com
smtp.example.com


Thanks for all the information. Very helpful. But I'm still a little
confused, because it seems like that's not enough information. If all I
put in is, for example, smtp.gmail.com, how is that directed to my own
email address? Do I still need to include other, more specific (i.e.
personal) information elsewhere?
May 3 '06 #4
On Wed, 03 May 2006 16:10:16 +0000, John Salerno wrote:
If all I
put in is, for example, smtp.gmail.com, how is that directed to my own
email address?


The address of the SMTP server does not specify where the email will go.
SMTP is a protocol, and when you are talking SMTP to the server, part of
what the conversation includes will be to whom you wish to send the email.

Please Google for information on SMTP. You can also start here:

http://en.wikipedia.org/wiki/SMTP

--
Steve R. Hastings "Vita est"
st***@hastings.org http://www.blarg.net/~steveha

May 3 '06 #5
Steve R. Hastings wrote:
On Wed, 03 May 2006 16:10:16 +0000, John Salerno wrote:
If all I
put in is, for example, smtp.gmail.com, how is that directed to my own
email address?


The address of the SMTP server does not specify where the email will go.
SMTP is a protocol, and when you are talking SMTP to the server, part of
what the conversation includes will be to whom you wish to send the email.

Please Google for information on SMTP. You can also start here:

http://en.wikipedia.org/wiki/SMTP


Thanks, I'll give it a look.
May 3 '06 #6
Uh, I don't sent to list :P

---------- Forwarded message ----------
From: Marco Carvalho <ma************@gmail.com>
Date: May 4, 2006 12:45 AM
Subject: Re: what is the 'host' for SMTP?
To: John Salerno <jo******@nospamgmail.com>
On 5/3/06, John Salerno <jo******@nospamgmail.com> wrote:
Steve R. Hastings wrote:

Thanks for all the information. Very helpful. But I'm still a little
confused, because it seems like that's not enough information. If all I
put in is, for example, smtp.gmail.com, how is that directed to my own
email address? Do I still need to include other, more specific (i.e.
personal) information elsewhere?


You need a little more than a smtp server address to send an e-mail.

If you are using smtplib:

import smtplib
sender = "yo********@gmail.com"
to = "de***************@example.com"
message = "blablabla"
smtplogin = "your_login_on_gmail"
smtppasswd = "your_password_on_gmail"
smtpserver = "smtp.gmail.com"

smtp = smtplib.SMTP(smtpserver)
smtp.login(smtplogin,smtppasswd)
smtp.sendmail(sender, to, message)
smtp.quit()

I don't put the correct construction of the message's headers and
body, it's another story :-)

--
Marco Carvalho (macs) | marcoacarvalho(a)gmail.com
http://arrakis.no-ip.info | http://cdd.debian-br.org
Maceio - Alagoas - Brazil
Debian GNU/Linux unstable (Sid)
GNU-PG ID:08D82127 - Linux Registered User #141545
Notícias Semanais do Debian em Português: http://www.debian.org/News/weekly
Alertas de Segurança Debian (DSA): http://www.debian.org/security
--
Marco Carvalho (macs) | marcoacarvalho(a)gmail.com
http://arrakis.no-ip.info | http://cdd.debian-br.org
Maceio - Alagoas - Brazil
Debian GNU/Linux unstable (Sid)
GNU-PG ID:08D82127 - Linux Registered User #141545
Notícias Semanais do Debian em Português: http://www.debian.org/News/weekly
Alertas de Segurança Debian (DSA): http://www.debian.org/security
May 4 '06 #7

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

Similar topics

4
by: Colin Kingston | last post by:
Hi For a college project I intend to produce a web based access database which will allow a group leader to send the same email to group members registered for that group. I want the group...
0
by: Ashish Sharma | last post by:
HI All, I urgently require a work around to get local SMTP Server Settings in IIS or smart host value if specified. We r using a Thiry Party Component which basically sends Secure Mails. Unlike...
6
by: MajorTom | last post by:
Hello, I getting this error An established connection was aborted by the software in your host machine here: TcpClient smtpSocket = new TcpClient(_serverSmtp, _portSmtp) port = 25 (smtp...
4
by: shapper | last post by:
Hello, I am trying to send an email from a form in my web page. I have the following codes: ... Dim mailSettings As New System.Net.Configuration.MailSettingsSectionGroup Dim smtpClient As...
11
by: justsome_newbie | last post by:
Hello experts! I'm trying to send mail from my C# Asp.Net webpage. I used the code samples at www.systemnetmail.com but it still won't send. I think the problem is on the iis or exchange server...
3
by: itarunachalam | last post by:
Hi Friends, Im doing web application in .net 2.0 for creating a forum, I want to receive the mail to local host(server). any one tell how to configure our localhost SMPT. Thanks in advance...
3
by: nickyeng | last post by:
i know alot of people faced this problem before. i searched google.com i search javaranch.com, no one article can help me solve the problem. I runs it in my localhost server, it runs well. But...
0
by: lopes80andre | last post by:
Hi, I'am trying to configure a Postfix server to send e-mails by SMTP using the SMTP server of my ISP. I have made a Postfix installation as "Internet with Smarthost". I'am using a domain in...
4
by: Kapil Choubisa | last post by:
Hello all I am using smtp for sending mail. it ask the smtp host name. that is smtp.Host = "smtp.gmail.com"; what is for yahoo/rediff/hotmail is there any one for globle mail systems.
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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...

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.