week of year and PureSMTP_SetXMailer to current domain name
Posted: Wed Jan 16, 2008 7:16 am
Guys working with databases and auto email alerts may find this useful
Here is a procedure which gives week number from date:
Here is another snippet to set the xmailer in the puresmtp library to the current domain name
it relys on the DNSAPIs at
http://www.purebasic.fr/english/viewtop ... highlight=
Here is a procedure which gives week number from date:
Code: Select all
Procedure WeekNumberFromDate()
Weeknum=1
For i=1 To DayOfYear(Date())
day_of_week=DayOfWeek(AddDate( Date(Year(Date()),01,01,1,1,1), #PB_Date_Day , i-1))
If (day_of_week=0) And Not(i=1)
Weeknum=Weeknum+1
;;PrintN ("day of week=0")
EndIf
;;PrintN ("Weeknum:"+Str(Weeknum))
Next i
ProcedureReturn Weeknum
EndProcedure
it relys on the DNSAPIs at
http://www.purebasic.fr/english/viewtop ... highlight=
Code: Select all
LoadDnsApi(0)
PureSMTP_SetContentType("text/html; charset=iso-8859-1")
ExamineIPAddresses()
;Debug IPString(NextIPAddress())
;Debug ReverseDnsQuery(NextIPAddress())
PureSMTP_SetXMailer(ReverseDnsQuery(NextIPAddress()))
CloseLibrary(0)