Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SMTPlib help
#5
(Apr-27-2020, 11:08 PM)Larz60+ Wrote: it looks as though your connection is not working.
there are probably other exceptions that aren't being shown.

change your exception routine to:
except Exception as e:
    print("ERROR ", str(e))
    logger.error('message')
    raise


AH thank you many more errors.... I can say I do have a route to my mail relay server as well and dscp markings are correct from the network side as well.

[tpolim001@srv01 ~]$ ./pncnetworktest.py 

Printing each pncnetwork record
 Beltway, 2020-04-26 23:18:13
Keystone, 2020-04-26 23:49:13
Freedom, 2020-04-26 23:00:19
New England, 2020-04-26 23:50:24

NAME PNCChecker-2020-04-27 19:10:00.txt
PATH /opt/scripts/output/PNCChecker-2020-04-27 19:10:00.txt
ERROR  [Errno 113] No route to host
Traceback (most recent call last):
  File "./pncnetworktest.py", line 68, in <module>
    s = smtplib.SMTP('mailrelay.xxxxxxxx.net')
  File "/usr/lib64/python3.6/smtplib.py", line 251, in __init__
    (code, msg) = self.connect(host, port)
  File "/usr/lib64/python3.6/smtplib.py", line 336, in connect
    self.sock = self._get_socket(host, port, self.timeout)
  File "/usr/lib64/python3.6/smtplib.py", line 307, in _get_socket
    self.source_address)
  File "/usr/lib64/python3.6/socket.py", line 724, in create_connection
    raise err
  File "/usr/lib64/python3.6/socket.py", line 713, in create_connection
    sock.connect(sa)
OSError: [Errno 113] No route to host
[tpolim001@srv01 ~]$ 
Reply


Messages In This Thread
SMTPlib help - by tpolim008 - Apr-27-2020, 07:07 PM
RE: SMTPlib help - by Larz60+ - Apr-27-2020, 10:56 PM
RE: SMTPlib help - by tpolim008 - Apr-27-2020, 11:01 PM
RE: SMTPlib help - by Larz60+ - Apr-27-2020, 11:08 PM
RE: SMTPlib help - by tpolim008 - Apr-27-2020, 11:11 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Sending Attachments via smtplib [SOLVED] AlphaInc 3 2,184 Oct-28-2021, 12:39 PM
Last Post: AlphaInc
  Sending random images via smtplib [SOLVED] AlphaInc 0 1,709 Oct-19-2021, 10:10 AM
Last Post: AlphaInc
  [UnicodeEncodeError from smtplib] yoohooos 0 3,414 Sep-25-2021, 04:27 AM
Last Post: yoohooos
  Understanding The Arguments for SMTPlib - sendmail JoeDainton123 3 2,736 Aug-03-2020, 08:34 AM
Last Post: buran
  TimeOutError when trying to initiate smtplib.SMTP thecosmos 0 3,356 Jun-19-2020, 05:30 AM
Last Post: thecosmos
  smtplib: string formatting not carrying over to email ClassicalSoul 1 2,673 Apr-22-2020, 09:58 PM
Last Post: bowlofred
  Issue with text encoding ans smtplib.SMTP.sendmail() JustSomeUsername383 1 4,163 Jul-23-2019, 03:15 PM
Last Post: JustSomeUsername383
  smtplib mail without subject anna 2 2,495 Apr-24-2019, 05:44 AM
Last Post: anna
  Smtplib: What does context argument means? Pythenx 1 3,107 Mar-27-2019, 06:25 PM
Last Post: nilamo
  SMTPLIB MIMEText HTML - Words being broken GaryK 2 3,792 Apr-16-2018, 04:08 PM
Last Post: GaryK

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020