Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: email questions

Reply
Thread Tools

Re: email questions

 
 
Scott Frankel
Guest
Posts: n/a
 
      02-08-2006

Seems I'm still having issues with syntax.

From what I can tell from my mail client, my outgoing mail server
name is either

mail.<ispname>.net
or
mail.<ispname>.net:<myUsername>@<myDomain>.com

The former yields the same socket error on connect() that I reported
earlier. The latter yields a "nonnumeric port" error upon
instantiation. Instantiating with the port number,

s = smtplib.SMTP("mail.<ispname>.net:<myUsername>@<myD omain>.com",
portNum)

yields the following error:

socket.gaierror: (7, 'No address associated with nodename')


Suggestions?

Thanks again
Scott




On Feb 8, 2006, at 9:47 AM, Carsten Haese wrote:

> On Wed, 2006-02-08 at 12:34, Scott Frankel wrote:
>> I'm looking for a way to send a simple, plain text email message
>> using Python. My initial attempts are failing with the following
>> error:
>>
>> socket.error: (61, 'Connection refused')
>>
>> Does this imply that I do not have the machine's smtp server
>> running?

>
> Yes.
>
>> (I don't; and I'd like to avoid setting it up.)

>
> You don't have to set up an smtp server to use smtplib. You should be
> able to use your ISP's outgoing mail server, as in
>
> s = smtplib.SMTP("<ISP's mail server name goes here>")
>
> HTH,
>
> Carsten.
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list


 
Reply With Quote
 
 
 
 
Heiko Wundram
Guest
Posts: n/a
 
      02-08-2006
Scott Frankel wrote:

>
> Seems I'm still having issues with syntax.
>
> From what I can tell from my mail client, my outgoing mail server
> name is either
>
> mail.<ispname>.net
> or
> mail.<ispname>.net:<myUsername>@<myDomain>.com
>
> The former yields the same socket error on connect() that I reported
> earlier. The latter yields a "nonnumeric port" error upon
> instantiation. Instantiating with the port number,


The latter isn't a hostname, it's a hostname (mail.<ispname>.net) padded
with user information for SMTP-Auth, which shouldn't be written in this
format anyway.

Probably your Provider only supports SMTPs or the like (which doesn't use
the default port 25, check for that. Otherwise: if connections are still
refused, does your provider really want you to use this mailserver? Or are
they providing some other relay? I know most ISPs I know and work with use
smtp.<ispname> for their outgoing client-relay.

--- Heiko.
 
Reply With Quote
 
 
 
 
Dennis Lee Bieber
Guest
Posts: n/a
 
      02-09-2006
On Wed, 8 Feb 2006 10:49:27 -0800, Scott Frankel <(E-Mail Removed)>
declaimed the following in comp.lang.python:


>
> mail.<ispname>.net


Not sure why you feel you need to hide it -- I'm presuming it is the
same ISP in your email address...

However, I'm currently finding a dead access to it...

C:\Documents and Settings\Dennis Lee Bieber>tracert smtp.pacbell.net
Unable to resolve target system name smtp.pacbell.net.

C:\Documents and Settings\Dennis Lee Bieber>tracert mail.pacbell.net

Tracing route to mail.pacbell.net [207.115.57.20]
over a maximum of 30 hops:

1 1 ms <1 ms <1 ms 192.168.1.1
2 17 ms 13 ms 14 ms user-11fa401.dsl.mindspring.com
[66.245.16.1]
3 13 ms 13 ms 15 ms cor02-vl-10.ca-sanfranc0.ne.earthlink.net
[209.165.103.65]
4 16 ms 13 ms 16 ms
bor01-ge-6-1.ca-sanfranc0.ne.earthlink.net [209.165.103.17]
5 22 ms 22 ms 22 ms
bor02-so-3-1.ca-pasadena0.ne.earthlink.net [209.165.109.154]
6 23 ms 27 ms 31 ms
bor01-ge-1-1-0.ca-losangel4.ne.earthlink.net [209.165.107.182]
7 28 ms 21 ms 22 ms ex1-g8-1s1.eqlaca.sbcglobal.net
[206.223.123.79]
8 24 ms 22 ms 23 ms ex2-p3-0.eqlaca.sbcglobal.net
[151.164.191.226]
9 25 ms 24 ms 24 ms bb1-p6-0.crrvca.sbcglobal.net
[151.164.41.34]
10 23 ms 24 ms 27 ms core2-p4-0.crrvca.sbcglobal.net
[151.164.41.1]
11 58 ms 61 ms 59 ms core2-p3-0.crhstx.sbcglobal.net
[151.164.241.125]
12 88 ms 89 ms 81 ms core1-p9-0.cratga.sbcglobal.net
[151.164.191.192]
13 83 ms 82 ms 84 ms core2-p1-0.cratga.sbcglobal.net
[151.164.241.82]
14 82 ms 82 ms 83 ms core2-p6-0.crhnva.sbcglobal.net
[151.164.41.206]
15 88 ms 89 ms 90 ms core2-p3-0.crnyny.sbcglobal.net
[151.164.188.197]
16 91 ms 88 ms 89 ms bb2-p3-0.nycmny.sbcglobal.net
[151.164.240.221]
17 88 ms 90 ms 87 ms ded2-g8-3-0.nycmny.sbcglobal.net
[151.164.41.181]
18 93 ms 90 ms 98 ms 66.10.112.6
19 * * * Request timed out.
20 * * * Request timed out.
21 * * * Request timed out.
22 * * * Request timed out.
23 * * * Request timed out.
24 * ^C
C:\Documents and Settings\Dennis Lee Bieber>


Whereas the news server is active...

C:\Documents and Settings\Dennis Lee Bieber>tracert news.pacbell.net

Tracing route to news.pacbell.net [206.13.28.26]
over a maximum of 30 hops:

1 <1 ms 2 ms <1 ms 192.168.1.1
2 14 ms 12 ms 12 ms user-11fa401.dsl.mindspring.com
[66.245.16.1]
3 16 ms 15 ms 13 ms cor01-vl-10.ca-sanfranc0.ne.earthlink.net
[209.165.103.33]
4 19 ms 18 ms 16 ms
bor01-ge-1-2.ca-sanfranc0.ne.earthlink.net [209.165.103.1]
5 21 ms 22 ms 22 ms
bor02-so-3-1.ca-pasadena0.ne.earthlink.net [209.165.109.154]
6 25 ms 32 ms 28 ms
bor01-ge-1-1-0.ca-losangel4.ne.earthlink.net [209.165.107.182]
7 24 ms 21 ms 22 ms ex1-g8-1s1.eqlaca.sbcglobal.net
[206.223.123.79]
8 23 ms 22 ms 22 ms bb1-p2-0.cranca.sbcglobal.net
[151.164.40.227]
9 28 ms 22 ms 24 ms core1-p9-0.cranca.sbcglobal.net
[151.164.40.93]
10 42 ms 42 ms 45 ms core2-p3-0.crscca.sbcglobal.net
[151.164.242.185]
11 41 ms 41 ms 44 ms core1-p1-0.crscca.sbcglobal.net
[151.164.241.233]
12 43 ms 41 ms 43 ms core2-p2-0.crsfca.sbcglobal.net
[151.164.42.47]
13 44 ms 49 ms 43 ms core1-p8-0.crsfca.sbcglobal.net
[151.164.242.73]
14 43 ms 41 ms 42 ms bb1-p12-0.snfcca.sbcglobal.net
[151.164.243.126]
15 46 ms 41 ms 42 ms bb2-g8-3-0.snfcca.sbcglobal.net
[151.164.43.49]
16 45 ms 42 ms 41 ms nntp1-sf.pbi.net [206.13.28.26]

Trace complete.

C:\Documents and Settings\Dennis Lee Bieber>
--
> ================================================== ============ <
> http://www.velocityreviews.com/forums/(E-Mail Removed) | Wulfraed Dennis Lee Bieber KD6MOG <
> (E-Mail Removed) | Bestiaria Support Staff <
> ================================================== ============ <
> Home Page: <http://www.dm.net/~wulfraed/> <
> Overflow Page: <http://wlfraed.home.netcom.com/> <

 
Reply With Quote
 
Carsten Haese
Guest
Posts: n/a
 
      02-09-2006
On Thu, 2006-02-09 at 00:50, Dennis Lee Bieber wrote:
> On Wed, 8 Feb 2006 10:49:27 -0800, Scott Frankel <(E-Mail Removed)>
> declaimed the following in comp.lang.python:
>
>
> >
> > mail.<ispname>.net

>
> Not sure why you feel you need to hide it -- I'm presuming it is the
> same ISP in your email address...
>
> However, I'm currently finding a dead access to it...
>
> C:\Documents and Settings\Dennis Lee Bieber>tracert smtp.pacbell.net
> Unable to resolve target system name smtp.pacbell.net.
>
> C:\Documents and Settings\Dennis Lee Bieber>tracert mail.pacbell.net
>
> Tracing route to mail.pacbell.net [207.115.57.20]
> over a maximum of 30 hops:
>
> 1 1 ms <1 ms <1 ms 192.168.1.1
> 2 17 ms 13 ms 14 ms user-11fa401.dsl.mindspring.com
> [66.245.16.1]
> 3 13 ms 13 ms 15 ms cor02-vl-10.ca-sanfranc0.ne.earthlink.net
> [209.165.103.65]
> 4 16 ms 13 ms 16 ms
> bor01-ge-6-1.ca-sanfranc0.ne.earthlink.net [209.165.103.17]
> 5 22 ms 22 ms 22 ms
> bor02-so-3-1.ca-pasadena0.ne.earthlink.net [209.165.109.154]
> 6 23 ms 27 ms 31 ms
> bor01-ge-1-1-0.ca-losangel4.ne.earthlink.net [209.165.107.182]
> 7 28 ms 21 ms 22 ms ex1-g8-1s1.eqlaca.sbcglobal.net
> [206.223.123.79]
> 8 24 ms 22 ms 23 ms ex2-p3-0.eqlaca.sbcglobal.net
> [151.164.191.226]
> 9 25 ms 24 ms 24 ms bb1-p6-0.crrvca.sbcglobal.net
> [151.164.41.34]
> 10 23 ms 24 ms 27 ms core2-p4-0.crrvca.sbcglobal.net
> [151.164.41.1]
> 11 58 ms 61 ms 59 ms core2-p3-0.crhstx.sbcglobal.net
> [151.164.241.125]
> 12 88 ms 89 ms 81 ms core1-p9-0.cratga.sbcglobal.net
> [151.164.191.192]
> 13 83 ms 82 ms 84 ms core2-p1-0.cratga.sbcglobal.net
> [151.164.241.82]
> 14 82 ms 82 ms 83 ms core2-p6-0.crhnva.sbcglobal.net
> [151.164.41.206]
> 15 88 ms 89 ms 90 ms core2-p3-0.crnyny.sbcglobal.net
> [151.164.188.197]
> 16 91 ms 88 ms 89 ms bb2-p3-0.nycmny.sbcglobal.net
> [151.164.240.221]
> 17 88 ms 90 ms 87 ms ded2-g8-3-0.nycmny.sbcglobal.net
> [151.164.41.181]
> 18 93 ms 90 ms 98 ms 66.10.112.6
> 19 * * * Request timed out.
> 20 * * * Request timed out.
> 21 * * * Request timed out.
> 22 * * * Request timed out.
> 23 * * * Request timed out.


This does not necessarily mean that the server is down. Routers can
filter traceroute and ping. Telnet to mail.pacbell.net on port 25 works
just fine. If the server had been down, the OP would not have gotten
"connection refused", he would have gotten a connection timeout.

The OP's problem is most likely that he's doing this:

s = smtplib.SMTP("mail.pacbell.net") # This already connects s
s.connect() # This reconnects s to localhost and is refused

when he should do this:

s = smtplib.SMTP() # make an unconnected SMTP instance
s.connect("mail.pacbell.net") # and connect it.

or simply this:

s = smtplib.SMTP("mail.pacbell.net")

-Carsten


 
Reply With Quote
 
Dennis Lee Bieber
Guest
Posts: n/a
 
      02-09-2006
On Thu, 09 Feb 2006 08:36:38 -0500, Carsten Haese <(E-Mail Removed)>
declaimed the following in comp.lang.python:

>
> This does not necessarily mean that the server is down. Routers can
> filter traceroute and ping. Telnet to mail.pacbell.net on port 25 works
> just fine. If the server had been down, the OP would not have gotten
> "connection refused", he would have gotten a connection timeout.
>

Agreed -- though it does seem inconsistent that they'd block it on
the mail server, but not on the news server <G>

And since a later post stated the problem was solved, if was
superfluous -- I'd likely have canceled my post but I was having all
sorts of problems with the earthlink servers last night (things like
"too many connections", news.west was hanging with a "retrieving 1
header for c.l.p", news.east was slow... And this AM news.east is
feeding me 3400 bodies for comp.lang.ada!)
--
> ================================================== ============ <
> (E-Mail Removed) | Wulfraed Dennis Lee Bieber KD6MOG <
> (E-Mail Removed) | Bestiaria Support Staff <
> ================================================== ============ <
> Home Page: <http://www.dm.net/~wulfraed/> <
> Overflow Page: <http://wlfraed.home.netcom.com/> <

 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mozilla Thunderbird Email NOT capturing clicked email links... AJPDLA Firefox 4 04-12-2006 07:05 PM
Email server timing out in email script John Silver Perl 0 02-04-2005 07:47 AM
Email ErrorPage to email Tee ASP .Net 0 06-23-2004 07:44 PM
Re: Questions....questions....questions Patrick Michael A+ Certification 0 06-16-2004 04:53 PM
HowTo:? open email client to send email Peter ASP .Net 0 07-01-2003 04:58 PM



Advertisments