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

Send Mail without HttpContext #160

Open
nomorechickennuggets opened this issue Nov 1, 2016 · 1 comment
Open

Send Mail without HttpContext #160

nomorechickennuggets opened this issue Nov 1, 2016 · 1 comment

Comments

@nomorechickennuggets
Copy link

Question here: http://stackoverflow.com/questions/40365517/create-new-httpcontext-for-mvcmailer-so-i-can-use-async-await

I'm using MVCMailer which depends on an HttpContext to send out mail.

In some cases I'm sending mail from a WebJob, or in an async task that is used in a flow that calls ConfigureAwait(false) so I lose the context before I hit the MVCMailer code.

My options seem to be:

Never use ConfigureAwait(false) (so many of my services use Mailing at some point, so one instance of this will remove the context I need)
New up an HttpContext if needed so that I can mail despite not having one
Not use MvcMailer and use a third party
I'm looking for the fast and easy solution - newing up an HttpContext if needed. Is this possible?

@JuanAcquistapace21
Copy link

Hi! Did you find any solution to your problem? I have the same problem

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