473,657 Members | 2,953 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2093
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.co m
smtp.example.co m

But it really could be anything:

norwegianblue.e xample.com
lovelyplumage.e xample.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.co m
smtp.example.co m


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******@nospa mgmail.com>
On 5/3/06, John Salerno <jo******@nospa mgmail.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********@gma il.com"
to = "de************ ***@example.com "
message = "blablabla"
smtplogin = "your_login_on_ gmail"
smtppasswd = "your_password_ on_gmail"
smtpserver = "smtp.gmail.com "

smtp = smtplib.SMTP(sm tpserver)
smtp.login(smtp login,smtppassw d)
smtp.sendmail(s ender, 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
2527
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 leader to be able to: Open a web page, choose a group, write an email and send the email to the group. The database will be hosted by a web hosting company which uses server
0
1397
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 System.Web.SMTPMail, it is not able to get local SMTP Server Settings and has to be given explicitly.. is there any solution to find the local SMTP Server Settings.. How can i send the mail without specifying any of the confuiguration
6
28447
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 server) and my smtp server is working fine from the outlook program
4
7546
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 New System.Net.Mail.SmtpClient
11
3457
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 side but I can't find any tutorials on how to configure the server(s). Any good links for this? Any advice is welcome!
3
3831
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 Arun.
3
5665
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 when i runs it in my company's server, it give this error : ---- javax.mail.SendFailedException: Sending failed; nested exception is: class javax.mail.MessagingException: Could not connect to SMTP host: mail.as.com.my, port: 25; nested exception is:...
0
2031
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 Godaddy, I have point "A (Host) Record" to my IP and the "MX Record" is also pointing to my IP. I have tested sending e-mail from my gmail.com account to my server, the server receive e-mails from gmail.com to my /home/andre/mbox successfully. ...
4
6627
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
8302
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
8820
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...
0
8718
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
6162
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
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4300
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
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
1937
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1601
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.