Skip to main content

I am trying to send an email using the PythonEmailer.

This works fine if I use the smtp.gmail.com server.

But I can not get it to work with the smtp.office365.com server TLS and port 587).

Has anybody got that working.

Any help is appreciated.

This is the error message I am getting:

Python Exception <SMTPException>: SMTP AUTH extension not supported by server.

Error encountered while calling function `email'

f_8(PythonFactory): PythonFactory failed to process feature

Hi @erik_jan,

Can you try switching from TLS to SSL in the transformer parameters? See if that works for you.

Their documentation here: https://support.office.com/en-us/article/Outlook-s...

suggests that some clients refer to implicit TLS as SSL.


Hi @erik_jan,

Can you try switching from TLS to SSL in the transformer parameters? See if that works for you.

Their documentation here: https://support.office.com/en-us/article/Outlook-s...

suggests that some clients refer to implicit TLS as SSL.

Hi Brian,

I have tried all combinations available:

TLS and SSL,

SMTP, POP and IMAP

ports for SMTP (587), IMAP (993) and POP (995)

But no combination worked.


Hi Brian,

I have tried all combinations available:

TLS and SSL, 

SMTP, POP and IMAP

ports for SMTP (587), IMAP (993) and POP (995)

But no combination worked.

Hi @erik_jan ,

Perhaps the python code within the transformer could be improved.  Can you try to add the following to the PythonCaller code within the custom transformer:

smtp.ehlo() 
smtp.starttls() 
smtp.ehlo()

Place it here:

 # Determine how we want to begin the connection
    if (connection_type=='TLS'):
        smtp=smtplib.SMTP(server,port)
        smtp.ehlo()
        smtp.starttls()
        smtp.ehlo()
    else:

Found from: http://stackoverflow.com/questions/64505/sending-mail-from-python-using-smtp


Hi @erik_jan ,

Perhaps the python code within the transformer could be improved.  Can you try to add the following to the PythonCaller code within the custom transformer:

smtp.ehlo() 
smtp.starttls() 
smtp.ehlo()

Place it here:

 # Determine how we want to begin the connection
    if (connection_type=='TLS'):
        smtp=smtplib.SMTP(server,port)
        smtp.ehlo()
        smtp.starttls()
        smtp.ehlo()
    else:

Found from: http://stackoverflow.com/questions/64505/sending-mail-from-python-using-smtp

Thanks @BrianAtSafe

That works fine.

Will this be implemented in the FME Store version of the PythonEmailer?


Hi @erik_jan,

Can you try switching from TLS to SSL in the transformer parameters? See if that works for you.

Their documentation here: https://support.office.com/en-us/article/Outlook-s...

suggests that some clients refer to implicit TLS as SSL.

Absolutely, I will make sure we look at implementing this enhancement. I'm glad it worked for you!


Reply