Page 1 of 1

Seems like a common Problem: Windows Install Wont Send Mail

Posted: Sun Jul 15, 2007 3:12 am
by Antarias
Softbounce 400: getaddrinfo failed

What does this mean?

Is this a DNS issue?

More Info

Posted: Sun Jul 15, 2007 6:10 am
by Antarias
When i execute this:

Code: Select all

import smtplib

def prompt(prompt):
    return raw_input(prompt).strip()

fromaddr = prompt("From: ")
toaddrs  = prompt("To: ").split()
print "Enter message, end with ^D (Unix) or ^Z (Windows):"

# Add the From: and To: headers at the start!
msg = ("From: %s\r\nTo: %s\r\n\r\n"
       % (fromaddr, ", ".join(toaddrs)))
while 1:
    try:
        line = raw_input()
    except EOFError:
        break
    if not line:
        break
    msg = msg + line

print "Message length is " + repr(len(msg))

server = smtplib.SMTP('localhost')
server.set_debuglevel(1)
server.sendmail(fromaddr, toaddrs, msg)
server.quit()
I get this:
C:\Documents and Settings\Administrator>"C:\Documents and Settings\Administrator
\Desktop\sendmail.py"
From: xxxxx@gmail.com
To: xxxxx@gmail.com
Enter message, end with ^D (Unix) or ^Z (Windows):
this is a test
^Z
Message length is 66
send: 'ehlo [10.10.10.123]\r\n'
reply: '502 Error: command "EHLO" not implemented\r\n'
reply: retcode (502); Msg: Error: command "EHLO" not implemented
send: 'helo [10.10.10.123]\r\n'
reply: '250 tank\r\n'
reply: retcode (250); Msg: tank
send: 'mail FROM:<xxxxx@gmail.com>\r\n'
reply: '250 Ok\r\n'
reply: retcode (250); Msg: Ok
send: 'rcpt TO:<xxxxx@gmail.com>\r\n'
reply: '250 Ok\r\n'
reply: retcode (250); Msg: Ok
send: 'data\r\n'
reply: '354 End data with <CR><LF>.<CR><LF>\r\n'
reply: retcode (354); Msg: End data with <CR><LF>.<CR><LF>
data: (354, 'End data with <CR><LF>.<CR><LF>')
send: 'From: xxxxx@gmail.com\r\nTo: xxxxx@gmail.com\r\n\r\nthis is a test\
r\n.\r\n'
reply: '250 Ok\r\n'
reply: retcode (250); Msg: Ok
data: (250, 'Ok')
send: 'quit\r\n'
reply: '221 Bye\r\n'
reply: retcode (221); Msg: Bye
The message does not get delivered. Any ideas?

-C