liiight / notifiers

The easy way to send notifications

Home Page:http://notifiers.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't send local email via Postfix

Kraeutergarten opened this issue · 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='')