liiight/notifiers

Can't send local email via Postfix

Kraeutergarten opened this issue ยท 3 comments

This bug is caused by this PR #203

I understand that for gmail a username // password is required, but not for email.
You don't need a username // password if you have a local postfix installed.

Thanks for opening your first issue here! Be sure to follow the issue template! ๐Ÿ‘‹๐Ÿž๐Ÿ‘‹

Thanks for the report.

Hi @liiight @Kraeutergarten
I was also facing a similar issue and the following piece of code worked for me.
The server was using postfix/sendmail.
I just kept the password and username as an empty string.

import notifiers
email = notifiers.get_notifier('email')
to = 'example@mail.com'
message = 'This is an automated mail'
host = 'localhost'
from_='noreply@mail.com'

email.notify(message=message, from_=from_, to=to, host=host, password='', username='')