Click here to Skip to main content
15,892,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi ,

i want to send asynchronous email with attachment in asp.net mvc 5.

how it possible pls help me

Thanks.
Posted

1 solution

Use the System.Net.Mail.MailMessage class.

You'll need IIS setup to provide SMTP services or an external SMTP server.

Personally, I inherit MailMessage to a class that implements my interface IMessageSender and inject it into the appropriate controller (this also allows you to use SMS, fax, whatever).

EDIT: To serve the async part just wrap it in a task.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900