473,769 Members | 5,846 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

smtp debugging methods

I'm having trouble with sending smtp mail. It's hanging after the
smtplib.SMTP() line. It doesn't works from home but not from work. What's
the best way to debug this?

# Here's my script
import smtplib
msg = "Subject: Hello\n\nThis is the\nbody of the message."
server = smtplib.SMTP("s mtp.gmail.com", 465)
# "Connection refused" normally means there is no server listening for
# connections on the specified IP/port-combination.
# use netstat -an to view connections.
server.set_debu glevel(1)
server.ehlo()
server.starttls ()
server.ehlo()
# !!! set the password
server.login("m yuser", "mypass")
server.sendmail ("...

# Here's the error
>>server = smtplib.SMTP("s mtp.gmail.com", 465)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/python2.4/smtplib.py", line 241, in __init__
(code, msg) = self.connect(ho st, port)
File "/usr/lib/python2.4/smtplib.py", line 304, in connect
(code, msg) = self.getreply()
File "/usr/lib/python2.4/smtplib.py", line 345, in getreply
line = self.file.readl ine()
File "/usr/lib/python2.4/socket.py", line 340, in readline
data = self._sock.recv (self._rbufsize )
socket.error: (113, 'Software caused connection abort')
Sep 14 '07 #1
3 5263
On 2007-09-14, Sean Nakasone <se**********@y ahoo.comwrote:
I'm having trouble with sending smtp mail. It's hanging after the
smtplib.SMTP() line. It doesn't works from home but not from work. What's
the best way to debug this?

# Here's the error
>>>server = smtplib.SMTP("s mtp.gmail.com", 465)
smtp.gmail.com port 465 is SSL only. Try port 587 instead.
Sep 14 '07 #2
On 14/09/2007, Sean Nakasone <se**********@y ahoo.comwrote:
I'm having trouble with sending smtp mail. It's hanging after the
smtplib.SMTP() line. It doesn't works from home but not from work. What's
the best way to debug this?

# Here's my script
import smtplib
msg = "Subject: Hello\n\nThis is the\nbody of the message."
server = smtplib.SMTP("s mtp.gmail.com", 465)
# "Connection refused" normally means there is no server listening for
# connections on the specified IP/port-combination.
# use netstat -an to view connections.
server.set_debu glevel(1)
server.ehlo()
server.starttls ()
server.ehlo()
# !!! set the password
server.login("m yuser", "mypass")
server.sendmail ("...

# Here's the error
>server = smtplib.SMTP("s mtp.gmail.com", 465)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/python2.4/smtplib.py", line 241, in __init__
(code, msg) = self.connect(ho st, port)
File "/usr/lib/python2.4/smtplib.py", line 304, in connect
(code, msg) = self.getreply()
File "/usr/lib/python2.4/smtplib.py", line 345, in getreply
line = self.file.readl ine()
File "/usr/lib/python2.4/socket.py", line 340, in readline
data = self._sock.recv (self._rbufsize )
socket.error: (113, 'Software caused connection abort')
There is no SMTP service on port 465 , its some other "service" or the
smtp server is in trouble, try it with port 587 instead.

HTH :)
Sep 14 '07 #3
Sean Nakasone <se**********@y ahoo.comwrote:
>
I'm having trouble with sending smtp mail. It's hanging after the
smtplib.SMTP () line. It doesn't works from home but not from work. What's
the best way to debug this?
It's quite possible that your network at work has a firewall blocking these
ports. Many employers allow outgoing connections only on ports 25, 80, and
443.
--
Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Sep 15 '07 #4

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

Similar topics

11
7655
by: Christian Patterer | last post by:
Hi, Even after searching the web for hours, I can't get my PHP configuration work. I have Apache and PHP installed. Now I want to use the mail() function in PHP. On the Linux server I have running Lotus Domino as SMTP server and I don't know how to configure PHP to use the Lotus Domino SMTP server. I use the setting SMTP=localhost to access the Domino server, but this
4
25421
by: Alex Hunsley | last post by:
I am using the smtp module to send emails via a local SMTP server on our network. I am failing with "connection refused" error, even though we definitely have an smtp server running on port 25! the code is like this: me = 'ahunsley@companyname.com' you = 'someonelse@companyname.com' msg = '*** alert'
7
15449
by: William Case | last post by:
Hi Folks, Does anyone have a line on some well written black box code that will handle SMTP mailing sessions and can be integrated into a VBA app? Thanks.
5
16700
by: R. Ian Lee | last post by:
I'm using the System.Web.Mail.SmtpMail object (.NET 1.1) to send email from an ASP.NET application. Everything works fine when I run it from Windows 2000 Server, but not from WinXP Pro. Is it not possible to send mail using the SMTP service or XP? Is there a different class that I should be using? I don't really need to send email from XP, but since I'm doing my development from XP it's really slows down debugging to have to comment...
0
3227
by: ZMan | last post by:
Scenario: This is about debugging server side scripts that make calls to middle-tier business DLLs. The server side scripts are legacy ASP 3.0 pages, and the DLLs are managed DLLs converted/developed with VB.NET. What I want from debugging is to be able to step into the methods in the DLLs called from ASP scripts using Visual Studio .NET. Background: For typical script debugging issues, you can read and follow the two documents on...
4
2595
by: z f | last post by:
Hi, i'm sending mail from the aspx page on the server. it is running on hosting, so i configure the System.Web.Mail.SmtpMail.SmtpServer property to my mail server. but problem is that sender email is also configurable and since the sender email is not from the SMTP server same host, it is not allows to send. i need to ba able to configure the SMTP Auth to be authenticated to different user from the sender email, but i didn't find...
2
1047
by: zubair | last post by:
Hello All I have just comeacross a problem: I'm debugging a site on my local computer using Visual Studio.net. When I send mail it gives error "System.Runtime.InteropServices.COMException: The transport failed to connect to the server" Should I configure the SMTP server correctly or there is another problem. Please help me. I wud be great ful
232
13342
by: robert maas, see http://tinyurl.com/uh3t | last post by:
I'm working on examples of programming in several languages, all (except PHP) running under CGI so that I can show both the source files and the actually running of the examples online. The first set of examples, after decoding the HTML FORM contents, merely verifies the text within a field to make sure it is a valid representation of an integer, without any junk thrown in, i.e. it must satisfy the regular expression: ^ *?+ *$ If the...
3
1703
by: piercy | last post by:
is there a way to verify a SMTP server? for instance. my users specify the SMTP server depending on there local settings. if they put in a wrong smtp address it will still attempt to send the email and wont display a fail. is there anyway to verify the server is a smtp server? or any other methods of verification i can take to check this? in basic a way of saying
0
9586
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
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
10210
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...
1
7406
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
6672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5298
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
5446
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2814
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.