Hi,
I am making a scheduler which need to send bulk email.
See the line of code given below
Dim objSendBulkEMail As New DotNetNuke.Services.Mail.SendTokenizedBulkEmail(objRoleNames, objUsers, False, "Stats Update is needed !!", strBody)
I am getting the error from this line. The error is "Object reference not set to an instance of an object.". But this same code i have written into a .aspx.vb file to test and it is working fine.
Can anyone tell me why it is not running under app_code .cs file?
Here is the details error
--
?ex
{"Object reference not set to an instance of an object."}
System.NullReferenceException: {"Object reference not set to an instance of an object."}
Data: {System.Collections.ListDictionaryInternal}
HelpLink: Nothing
InnerException: Nothing
Message: "Object reference not set to an instance of an object."
Source: "DotNetNuke"
StackTrace: " at DotNetNuke.Entities.Portals.PortalController.GetCurrentPortalSettings()
at DotNetNuke.Services.Mail.SendTokenizedBulkEmail.initObjects()
at DotNetNuke.Services.Mail.SendTokenizedBulkEmail..ctor(List`1 AddressedRoles, List`1 AddressedUsers, Boolean removeDuplicates, String Subject, String Body)
at Ryno.DNN.Modules.RynoPilotStats.Business.RynoStatsController.YearlyStasUpdateConfirmation() in E:\DNN\DNN_Apr\App_Code\RynoPilotStats\RynoPilotStatsController.vb:line 58
at Ryno.DNN.Modules.RynoPilotStats.Business.ScheduledStats.DoWork() in E:\DNN\DNN_Apr\App_Code\RynoPilotStats\ScheduledStats.vb:line 21"
TargetSite: {System.Reflection.RuntimeMethodInfo}
''''''''
Thanks
--Mohsin