Allow anonymous users to load site contact form without granting admin privileges I'm including the site contact form on a page with these 2 lines.

  module_load_include('inc', 'contact', 'contact.pages');
  print render(drupal_get_form('contact_site_form'));


The page loads as expected when a user is logged in, but for an anonymous user the page returns a 403.

If I give the "Administer contact forms and contact form settings" permission to anonymous users, then the page will load for anonymous users. I gave the "Use the site-wide contact form" permissions to anonymous users, but they still get an access denied error.

Is there a way to allow the form to load for anonymous uses without giving them admin privileges?
The Access Denied error is returned because the following code executed by code_site_form(). (Notice the call to drupal_access_denied().)

  $limit = variable_get('contact_threshold_limit', 5);
  $window = variable_get('contact_threshold_window', 3600);
  if (!flood_is_allowed('contact', $limit, $window) &amp;&amp; !user_access('administer contact forms')) {
    drupal_set_message(t("You cannot send more than %limit messages in @interval. Try again later.", array('%limit' =&gt; $limit, '@interval' =&gt; format_interval($window))), 'error');
    drupal_access_denied();
    drupal_exit();
  }


Users with the "administer contact forms" permission don't get that error, since the limit for the sent messages doesn't apply to them.

Check those Drupal variables have not been set to different values that lower the number of allowed messages. The default is 5 messages in 1 hour.

As side note, render(drupal_get_form('contact_site_form')) would cause a "call-time pass-by-reference" warning in PHP 5.3, since render() is expecting a variable passed by reference, but drupal_get_form() doesn't return a reference. PHP 5.4 will raise a fatal error for that same code. The code calling render() should always use a variable.

module_load_include('inc', 'contact', 'contact.pages');
$form = drupal_get_form('contact_site_form');
print render($form);