Fwd: what is the 'host' for SMTP?

Marco Carvalho marcoacarvalho at gmail.com
Wed May 3 23:47:44 EDT 2006


Uh, I don't sent to list :P

---------- Forwarded message ----------
From: Marco Carvalho <marcoacarvalho at gmail.com>
Date: May 4, 2006 12:45 AM
Subject: Re: what is the 'host' for SMTP?
To: John Salerno <johnjsal at nospamgmail.com>


On 5/3/06, John Salerno <johnjsal at 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 = "your_email at gmail.com"
to = "destination_email at 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



More information about the Python-list mailing list