rob-luke / emails-html-to-pdf

Convert emails without attachments to pdf and send as email
31 stars 7 forks source link

SMTP authentication fails, Need to use STARTTLS #30

Open chirmstream opened 2 years ago

chirmstream commented 2 years ago

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 commented 2 years ago

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.

rob-luke commented 2 years ago

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

chirmstream commented 2 years ago

@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.

rob-luke commented 2 years ago

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

chirmstream commented 2 years ago

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 commented 2 years ago

Pull request is up.

ajquick commented 2 years ago

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.