如何使电子邮件通知像谷歌日历?

编程入门 行业动态 更新时间:2024-10-25 08:28:10
本文介绍了如何使电子邮件通知像谷歌日历?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我使用

  • 在asp的MVC 2.0
  • 在C#
  • 在.NET 4.0
  • 在MS SQL Server 2005中
  • 在IIS 7.0

我想打一个电子邮件通知系统,就像许多网站都有,如谷歌。我希望用户能够设置提醒日期和该日期是打了一个电子邮件发送给他们。

I want to make an email notifier system just like many sites have such as google. I want user to be able to set a reminder date and when that date is hit a email is sent to them.

我不知道如何做到这一点。

I am not sure how to do this.

我听到一对夫妇方法,但还没有找到如何做他们。任何教程

I heard of a couple ways but have not found any tutorials on how to do them.

  • Windows计划
  • 通过MS SQL服务器(认为SQL Server代理?)

随着Windows计划,我不认为它会工作一个共享的主机环境。我想preFER如果它这样做,但如果有一个很大的区别,然后我可以忍受了这种能力。

With the windows scheduler I don't think it would work on a shared hosting environment. I would prefer if it did but if there is a big difference then I can live with out that ability.

我也希望在不久的将来支持短信所以解决方案应该能够扩大与合作,以及如果可能的话。

I also want in the very near future to support SMS messages so the solution should be able to expand to work with that as well if possible.

推荐答案

本的博客文章 presents一个非常有效的(虽然有点'哈克')问题的解决方案,将工作在一个共享的主机环境。这是用在计算器杰夫指派徽章的用户(我不知道,如果是的话仍然使用它虽然)。

This blog post presents a very effective (though somewhat 'hacky') solution to your problem that will work in a shared hosting environment. This is what Jeff used in StackOverflow to assign badges to users (I don't know if SO is still using it though).

对于code实际发送的邮件,你应该看看周围的互联网,因为有关于如何做到这一点无尽code的例子。一个可能的答案可能是:

For the code to actually send the email, you should look around the Internet since there are endless code examples on how to do that. One possible answer could be:

public void SendEmail() { MailMessage loMsg = new MailMessage(); loMsg.From = new MailAddress("from@domain"); loMsg.To.Add(new MailAddress("to@domain")); loMsg.Subject = "Subject"; loMsg.Body = "Email Body"; var smtp = new SmtpClient { Host = "smtp.gmail", Port = 587, EnableSsl = true, DeliveryMethod = SmtpDeliveryMethod.Network, UseDefaultCredentials = false, Credentials = new System.Net.NetworkCredential("username", "password") }; smtp.Send(loMsg); }

看一看,看看是否有帮助。

Take a look and see if it helps

更多推荐

如何使电子邮件通知像谷歌日历?

本文发布于:2023-11-28 09:41:07,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1641885.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:电子邮件   日历   通知   像谷歌

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!