I have a specific place in my code, where I am sending an email message. Well, it is not important at all here to wait for this method to be finished, this is just a task which should happen in some near future, but not necessarily RIGHT NOW.
I would like to know if this is safe:
// some stuff here...
Task.Run(SendEmail);
// and here too... but don't wait for the email to be sent, just go!!
Is this alright? Will this method be always executed? It won't lead to any thread-blocking problems, will it (given that the method itself is thread-safe)?
Also, what is a good way to run such a task? Would it be better to call:
SendEmail();
provided that this method is async
?
public static async Task SendEmail()