1 (edited by zero Technology 2015-11-21 04:52:21)

Topic: how to connect with smtp

======== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.2
- Linux/BSD distribution name and version: CentOS 6
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Nginx
====

Hi;

I'm trying to send message via smtp with Python

what I'm doing is :


import smtplib

from email.mime.text import MIMEText

msg = MIMEText('Testing some Mailgun awesomness')
msg['Subject'] = "Hello"
msg['From']    = "user@domain.tld"
msg['To']      = "user@gmail.com"

s = smtplib.SMTP('domain.tld', 587)

s.login('user@domain.tld', '123456')
s.sendmail(msg['From'], msg['To'], msg.as_string())
s.quit()

show to me this error :

 smtplib.SMTPException: SMTP AUTH extension not supported by server. 

my question is :

1. how do I know what is smtp information on my server (host, port, username, password)
2. how can I allow tls connection on my server.

thanks.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: how to connect with smtp

Add one line after 's = smtplib.SMTP('domain.tld', 587)':

s.starttls()

That's it. You can find this smtplib example in official Python document.

iRedMail forces users to send email through TLS secure connection.

3

Re: how to connect with smtp

ZhangHuangbin wrote:

Add one line after 's = smtplib.SMTP('domain.tld', 587)':

s.starttls()

That's it. You can find this smtplib example in official Python document.

iRedMail forces users to send email through TLS secure connection.

Hi;

thank u very much! it's working now.

but I have question why when I'm using secure tls and not when I'm sending mail to users on (hotmail, gmail) resived to junk file?

thanks.

4

Re: how to connect with smtp

Mail receiver like Hotmail/Gmail/... has its own anti-spam solutions, it's not up to you. so it may happen.