特别是几天之后发送了电子邮件 [英] Sheduled emails in particular days later

查看:132
本文介绍了特别是几天之后发送了电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友,

我在实施代码时遇到了一些问题。我对如何发送电子邮件有所了解,但不知道如何在特定日期发送电子邮件或如何编写电子邮件电子邮件。

例如: - 如果我注册了任何网站,那么如果我没有使用这个网站,那么特别是15天后自动发送通知电子邮件。我不知道怎么做,你会不会喜欢向我推荐任何想法或信息。



感谢先进!!

Dear Friend,
I have some problem when implementing code.I have an idea about that "how to send email" but no idea about "how to send email in particular days or how to sheduled emails".
For example :-if i am registered any website then if i am not used this website then automatically send notification emails particular 15 days later.I cant get an idea how to do so would you like to suggest me anything idea or information.

Thanks in advanced !!

推荐答案

以下3个步骤将完成你的工作:

1.在数据库中创建一个表(比如电子邮件),并插入与主题,正文,发件人,收件人等相关的所有信息以及日期。电子邮件将被发送(EmailSendDate)。

2.写一个SP,如果当前日期等于EmailSendDate,将阅读上面(电子邮件)表并发送电子邮件。

3.在SQL服务器中创建一个将每天运行的作业(或者你想要的方式),并在那个工作中打电话给SP.



希望这会对你有帮助。



~Amol
Following 3 steps will get your job done:
1. Create a table in the database (say Email) and insert all the information related the email like subject, body, From, To etc. along with the date on which the email is to be sent (EmailSendDate).
2. Write a SP which will read above (Email) table and send email if current date is equal to the EmailSendDate.
3. Create a Job in the SQL server which will run every day (or the way you want), and call above SP in that job.

Hope this will help you.

~Amol


我认为最好的方法是使用SQL Server Job。您可以根据需要在预定义的时间间隔内使用它。供参考,您可以参考以下链接。



SQL Server代理的调度程序GUI [ ^ ]



[/ a href =http://www.codeproject.com/Tips / 367470 / Manage-SQL-Server-Agent-Jobs-using-Csharptarget =_ blanktitle =New Window> ^ ]



安排工作 [ ^ ]



如何:安排作业(SQL Server Management Studio) [ ^ ]



[重要]:



sp_send_dbmail [ ^ ]



问候......:笑:
The best way i think would be to use SQL Server Job. You can use that on predefined time interval as you want. For reference you can refer to below links.

A scheduler GUI for SQL Server Agent[^]

Manage SQL Server Agent Jobs using C#[^]

Schedule a Job[^]

How to: Schedule a Job (SQL Server Management Studio)[^]

[Important]:

sp_send_dbmail[^]

Regards.. :laugh:


这篇关于特别是几天之后发送了电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆