emails-html-to-pdf icon indicating copy to clipboard operation
emails-html-to-pdf copied to clipboard

SMTP authentication fails, Need to use STARTTLS

Open chirmstream opened this issue 2 years ago • 7 comments

So from my experience the SMTP server that I use only works when I use STARTTLS. I tried the parameter SMTP_STARTTLS set to true but it doesn't work.

raise SMTPAuthenticationError(code, resp)
smtplib.SMTPAuthenticationError: (535, b'5.7.8 Error: authentication failed: UGFzc3dvcmQ6')

I have tried SMTP_TLS true and false but haven't been able to get it to connect.

chirmstream avatar Mar 03 '22 22:03 chirmstream

I realized that the reason my SMTP authentication is failing is because I am using a 3rd party SMTP server and have different login credentials than the IMAP server. We need SMTP_USERNAME and SMTP_PASSWORD variables.

chirmstream avatar Mar 06 '22 19:03 chirmstream

Thanks for digging in to this error @dglb99. Are you able to submit a PR to fix this issue?

rob-luke avatar Mar 10 '22 04:03 rob-luke

@rob-luke I have spent a few hours trying a few things but have been unsuccessful so far. Unfortunately I do not know python (or any coding language for that matter) so we'll see. I was able to get rid of the login error, but I am having other issues and it is still not sending emails.

chirmstream avatar Mar 10 '22 17:03 chirmstream

Thanks for trying. I'll take a look in the next week or so. I'll report back here on my progress.

rob-luke avatar Mar 10 '22 20:03 rob-luke

I think I got it working. I will do some more reading about pull requests first, I want to do it properly, otherwise you should see it pretty soon.

chirmstream avatar Mar 10 '22 20:03 chirmstream

Pull request is up.

chirmstream avatar Mar 10 '22 22:03 chirmstream

I have also added a PR #34 which adds support for Port SMTP 465.

That port requires the use of the function SMTP_SSL instead of SMTP.

ajquick avatar May 21 '22 19:05 ajquick