Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify which account to send mail #51

Open
Kianoosh76 opened this issue Mar 31, 2018 · 1 comment
Open

Specify which account to send mail #51

Kianoosh76 opened this issue Mar 31, 2018 · 1 comment

Comments

@Kianoosh76
Copy link

Hi, is it possible to specify the account we want to send mail from it? Because we may need different sender accounts(but their mail hosts are same)
I mean Something similar to auth_user auth_password input parameters in django builtin send_mail function

@simondrabble
Copy link

You can pass auth_user and auth_password to send_mail, so just determine what those should be and pass them in:

if some_condition():
   auth_user = 'user1'
   auth_pass = 'pass1'

else:
  auth_user = 'user2'
  auth_pass = 'pass2'

mail.send_mail(..., auth_user=auth_user, auth_password=auth_pass, ...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants