24小时后自动发送邮件

编程入门 行业动态 更新时间:2024-10-25 08:18:58
本文介绍了24小时后自动发送邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

24小时后自动发送邮件.

send mail automatically after 24 hours.

推荐答案

您可以通过数据库尝试此代码. 您需要SSIS每隔一段时间调用存储过程. 请检查此存储过程(我从这里获得了它:www.experts-exchange/Microsoft/Development/MS-SQL-Server/Q_21944312.html): You can do this by your DataBase try this code. You need SSIS to call a stored procedure every period of time. Please check this for the stored procedure (I got it from here: www.experts-exchange/Microsoft/Development/MS-SQL-Server/Q_21944312.html): CREATE PROCEDURE [dbo].[PROC_CDOMAILALERTS] @From varchar(200), @To varchar(200), @ReplyTo varchar(200), @Cc varchar(200), @ArchiveId varchar(200), @SMTPServer varchar(100), @Subject varchar(200) = " ", @Body varchar(4000) = " " AS BEGIN Declare @iMsg int Declare @hr int Declare @ht int Declare @source varchar(255) Declare @description varchar(500) Declare @output varchar(1000) --******************************************************************** --Set the ids to which Bcc should be sent Set @ArchiveId = @ReplyTo + ',' + @ArchiveId --************* Create the CDO.Message Object ************************ EXEC @hr = sp_OACreate 'CDO.Message', @iMsg OUT --***************Configuring the Message Object ****************** -- This is to configure the Remote Server Name or IP address. -- Replace MailServerName by the name or IP of your SMTP Server. EXEC @hr = sp_OASetProperty @iMsg, 'Configuration.fields("schemas.microsoft/cdo/configuration/sendusing").Value','2' EXEC @hr = sp_OASetProperty @iMsg, 'Configuration.fields("schemas.microsoft/cdo/configuration/smtpserver").Value', @SMTPServer -- Save the configurations to the message object. EXEC @hr = sp_OAMethod @iMsg, 'Configuration.Fields.Update', null -- Set the e-mail parameters. EXEC @hr = sp_OASetProperty @iMsg, 'To', @To EXEC @hr = sp_OASetProperty @iMsg, 'ReplyTo', @ReplyTo EXEC @hr = sp_OASetProperty @iMsg, 'Cc', @Cc EXEC @hr = sp_OASetProperty @iMsg, 'BCc', @ArchiveId EXEC @hr = sp_OASetProperty @iMsg, 'From', @From EXEC @hr = sp_OASetProperty @iMsg, 'Subject', @Subject -- If you are using HTML e-mail, use 'HTMLBody' instead of 'TextBody'. EXEC @hr = sp_OASetProperty @iMsg, 'TextBody', @Body EXEC @hr = sp_OAMethod @iMsg, 'Send', NULL EXEC @ht = sp_OADestroy @iMsg RETURN @hr END

链接[ ^ ]

link [^]

希望此 [ ^ ]可能会为您提供帮助. Hope this[^] might help you.

更多推荐

24小时后自动发送邮件

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

发布评论

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

>www.elefans.com

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