如何使用Windows服务在C#中发送电子邮件? [英] How to use windows services to send email in C#?
问题描述
大家好,
我在ASP.NET C#中有一个Web应用程序,在C#中有Windows应用程序.
此应用程序基本上是为考试中心创建的.
Web应用程序用于创建候选人,证书和ExamSession.
候选人使用Windows应用程序编写考试.
现在我要创建Windows服务,以便在创建ExamSession时发送电子邮件.
我尝试过的事情:
我必须使用WebApplication Business逻辑并发送电子邮件.
我还没有创建Windows服务.
我在Google上搜索.但是..我不清楚.
大家帮帮我吧.
谢谢
Hi Guys,
I have one web application in asp.net c# and windows application in c#.
This application is basically created for Exam Centers.
Web Application is used to Create Candidates, Certificates and ExamSessions.
Where as Windows application is used by the Candidate to write the Exam.
My turn is to create windows services to send email, whenever ExamSession is created.
What I have tried:
I have to use the WebApplication Business logic and send Email.
I haven''t created windows services.
I searched on Google. but.. i''m not clear.
Please guys help me.
Thanks
推荐答案
您将要使用SMTPClient类.这里的文档和示例 SmtpClient类(System.Net .Mail) [
You''ll want to use the SMTPClient class. Documentation and example here, SmtpClient Class (System.Net.Mail)[^]
这篇关于如何使用Windows服务在C#中发送电子邮件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!