Cant send email using smtp with port 26 07-10-2014, 01:06 AM
#1
I try to send email using SMTP with port 25 but after some hours the port 25 blocked.
Then i try using port 26 but it dosn't work. It can't send email.
code:
Then i try using port 26 but it dosn't work. It can't send email.
code:
Code:
from smtplib import SMTP
import datetime
debuglevel = 0
smtp = SMTP()
smtp.set_debuglevel(debuglevel)
smtp.connect('mail.ommmbot.com', 26)
smtp.login('support@ommmbot.com', '*******')
from_addr = "Support <support@ommmbot.com>"
to_addr = "squ106595@gmail.com"
subj = "hello"
date = datetime.datetime.now().strftime( "%d/%m/%Y %H:%M" )
message_text = "Hello\\nThis is a mail from your server\\n\\nBye\\n"
msg = "From: %s\\nTo: %s\\nSubject: %s\\nDate: %s\\n\\n%s" \
% ( from_addr, to_addr, subj, date, message_text )
smtp.sendmail(from_addr, to_addr, msg)
smtp.quit()
![[+]](https://sinister.ly/images/modern/collapse_collapsed.png)