Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Proper way to access host settingsProper way to access host settings
Previous
 
Next
New Post
5/8/2007 10:45 AM
 

Hi,

I am currently trying to develop a module for DNN 4.5.1. The module emails a list of people. Currently I am using the DotNetNuke.Services.Mail.Sendmail function to do this. My question is that I need to get the host settings for this email and I don't want to hardcode it because it needs to be used on several sites, so how do I access the host settings?

I know that DotNetNuke.Entities.Portals.PortalSettings.GetHostSettings returns me a hashtable but I am unsure what the proper key names are. If there is documentation I have been unsuccessful in finding it, and it would be a extremely helpful if I had something like that. Your help is greatly appreciated.

Thanks

 

 
New Post
5/8/2007 11:07 AM
 

What host setting are you trying to access?

I use the following to retrieve a value I setup in Host Settings. You could do the same if you know the name of the item you're looking for.

 

string s = HostSettings.GetHostSetting(Utility.PublishSetup+ PortalId);

Your best bet would probably be to figure out the name your trying to get back by looking in the HostSettings table.


Chris Hammond
Former DNN Corp Employee, MVP, Core Team Member, Trustee
Christoc.com Software Solutions DotNetNuke Module Development, Upgrades and consulting.
dnnCHAT.com a chat room for DotNetNuke discussions
 
New Post
5/8/2007 7:29 PM
 

A comments on sending email in DNN.

If you are trying to send a block of emails - making a call to sendmail for each seperate email - then  you will need to have a look at how the Newsletter/Bulk Emailer module works.

Sending a lot of emails can be somewhat time consuming - and depending on the response speed of your email server - you are likely to get PAGE timeouts before all the emails are sent - the result being not all the emails will be processed.

To get around this you will need to use a seperate thread to process your emails - so that the PAGE timeout does not occur.

>>>

As for how to get host settings - I assume you mean the portal settings here:

Dim _portalSettings As PortalSettings = PortalController.GetCurrentPortalSettings()

The _portalSettings object should contain the settings you are looking for.

 

 

Westa

 
New Post
5/10/2007 10:15 AM
 

I was trying to get access to the host email. I did figure out what was wrong. I had grabbed the hash table returned by GetHostSettings() and I was trying to do this: GetHostSettings().Values["hostEmail"]. I finally realized that I needed to assign GetHostSettings() to a hashtable variable and just access it with the hastable[x]. I also didn't realize the key's were simply the HostSettings column names.

Thanks for the help.

 
New Post
5/10/2007 10:19 AM
 

Creating a thread is a really good idea actually since it is possible a significant number of emails needs to be sent at a time, thanks for the advice. Do I need to use any special functionality through the DNN framework when creating a thread, or should I just use the normal C#/VB libraries?

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Proper way to access host settingsProper way to access host settings


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out