<%
Function EmailUserBirthdayNotice
strDOB=mid(strtodate(strForumTimeAdjust),4,4)
strSql="SELECT C_VARIABLE, C_VALUE FROM "& strTablePrefix & "CONFIG_NEW WHERE C_VARIABLE='STRBIRTHMAIL'"
set rsBDay=my_Conn.Execute(strSql)
if not rsBDay.EOF then
strCDOB=rsBDay("C_VALUE")
rsBDay.Close
end if
set rsBDay=Nothing
if strCDOB<>strDOB then
strSql="UPDATE "& strTablePrefix & "CONFIG_NEW SET C_VALUE='" & STRDOB & "' WHERE C_VARIABLE='STRBIRTHMAIL'"
my_Conn.Execute(strSql)
strSql="SELECT M_FIRSTNAME, M_EMAIL, M_DOB FROM " & strMemberTablePrefix & "MEMBERS WHERE MID(M_DOB,4)="&strDOB
set rsDOB=my_Conn.Execute(strSql)
if not rsDOB.EOF then
do until rsDOB.EOF
strRecipientsName = rsDOB("M_FIRSTNAME")
strRecipients = rsDOB("M_EMAIL")
Call SMail
loop
rsDOB.Close
end if
set rsDOB=Nothing
Sub SMail
strFrom = "My Forum"
strFromName = strForumTitle
strsubject = "Happy Birthday " & userName & " !"
strMessage = "Hello " & PWMember_Name & vbNewline & vbNewline
strMessage = strMessage & "You received this message from My Forum because today is your birthday. We wanted to wish you a Happy Birthday!" & vbNewline & vbNewline
strMessage = strMessage & vbNewLine & "Have a great birthday!." & vbNewLine & vbNewLine
strMessage = strMessage & vbNewLine & "My Forum" & vbNewLine & vbNewLine
%>
<!--#INCLUDE FILE="inc_mail.asp" -->
<%
End Sub
end if
End Function
%>
To add the variable to the config_new table, save the following as dbs.BMail and execute from admin control panel.
Birthday Mail Mod v1.0
[INSERT]
CONFIG_NEW
(C_VARIABLE,C_VALUE)#('strBirthMail',0)
[END]