Skip to main content
Solved

How to use PythonEmailer with office 365

  • February 10, 2016
  • 5 replies
  • 71 views

erik_jan
Contributor
Forum|alt.badge.img+18

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

Best answer by brianatsafe

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.

View original
Did this help you find an answer to your question?
This post is closed to further activity.
It may be a question with a best answer, an implemented idea, or just a post needing no comment.
If you have a follow-up or related question, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

5 replies

brianatsafe
Safer
Forum|alt.badge.img+11
  • Safer
  • Best Answer
  • February 11, 2016

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.


erik_jan
Contributor
Forum|alt.badge.img+18
  • Author
  • Contributor
  • February 11, 2016
brianatsafe wrote:

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.


brianatsafe
Safer
Forum|alt.badge.img+11
  • Safer
  • February 11, 2016
erik_jan wrote:

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


erik_jan
Contributor
Forum|alt.badge.img+18
  • Author
  • Contributor
  • February 11, 2016
brianatsafe wrote:

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?


brianatsafe
Safer
Forum|alt.badge.img+11
  • Safer
  • February 11, 2016
brianatsafe wrote:

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!


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings