Send email with attachment using Windows Service in C# and VB.Net

Last Reply 5 months ago By dharmendr

Posted 5 months ago

I need to create a Windows Task scheduler to send email with excel attachment (which is saved in local drive) using C#. Scheduler should automatically triggers email daily at 8PM. 


Posted 5 months ago

Do we need to hardcode sender email password for sending email?


Posted 5 months ago

No its not nessary to hard code sender email password. You can save it in database or in app / web config. Then retrieve and assign it from code behind.