Sending mail

Newbie Spellweaver
Joined
Dec 7, 2003
Messages
36
Reaction score
1
Location
Dallas, Texas
How do I change the RMS_Sendmail procedure to only send the 1/1/1900 date....Anyone know sql that can help me...I know its been done but no one is sharing the code...

Here is what I have



CREATE PROCEDURE RMS_SENDMAIL
@Recipient varchar(14),
@Sender varchar(14),
@Title char(80),
@Line int,
@MailContent varchar(1000),
@Item varchar(100)

AS
set nocount on

begin transaction RMS_SENDMAIL

DECLARE @RowCount int
DECLARE @MailDate datetime
SET @MailDate=cast(convert(varchar, GetDate(), 120) as datetime)

SELECT @RowCount=COUNT(*) FROM tblMail1 WHERE Time=@MailDate AND Recipient=@Recipient
IF @RowCount=0
BEGIN
INSERT tblmail1 (time, Recipient, Sender, ReadOrNot, Title, Line, Content, Item) VALUES (@maildate, @Recipient, @Sender, 0, @Title,@Line, @MailContent, @Item)
END
ELSE
BEGIN
SELECT @MailDate=1/1/1900 FROM tblMail1 WHERE Recipient=@Recipient
INSERT tblmail1 (Time, Recipient, Sender, ReadOrNot, Title, Line, Content, Item) VALUES (@MailDate,@Recipient, @Sender, 0, @Title,@Line, @MailContent, @Item)
END

commit transaction RMS_SENDMAIL
GO


how do I change it to work?

Anyone?
 
Back