Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 957277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T00:40:36+00:00 2026-05-16T00:40:36+00:00

When submitting a message in my site-wide contact form in Drupal 6.x I get

  • 0

When submitting a message in my site-wide contact form in Drupal 6.x I get the following message along the top of every message:

[Name] sent a message using the contact form at [www.mysite.com/contact]

I would like to remove this message. Looking around, I’ve found it comes from the contact.module here:

$message['body'][] = t("!name sent a message using the contact form at !form.", array('!name' => $params['name'], '!form' => url($_GET['q'], array('absolute' => TRUE, 'language' => $language))), $language->language);

I’ve done a bit of research and it seems that I need to create a custom module with a hook_mail_alter() function to edit the contact.module. When it comes to this I get a bit lost. Could anyone kindly take me through the steps to accomplish the task?

Many thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T00:40:37+00:00Added an answer on May 16, 2026 at 12:40 am

    I did something like that recently. Here is a template you can use to get what you need. Most is from the contact module. The code below is from Drupal 7 but should work as is in Drupal 6.

    /**
     * Implementation of hook_mail_alter().
     */
    function modulename_mail_alter(&$message) {
      if ($message['id'] == 'contact_page_mail') {
        $language = $message['language'];
        $params = $message['params'];
        $variables = array(
          '!form-url' => url($_GET['q'], array('absolute' => TRUE, 'language' => $language)),
          '!sender-name' => format_username($params['sender']),
          '!sender-url' => $params['sender']->uid ? url('user/' . $params['sender']->uid, array('absolute' => TRUE, 'language' => $language)) : $params['sender']->mail,
        );
        $message['body'] = array();
        $message['body'][] = t("Your custom message with variables", $variables, array('langcode' => $language->language));
        $message['body'][] = $params['message']; // Append the user's message/
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I’m submitting a form using java HtmlUnit package. I am able to get pages
When submitting a form to create a new object i get an error message
I'm submitting to a rails webservice the following message: xmlPostData = <message> <message-text> +
Upon submitting this form on my site. It send me to a page that
I have a form I am submitting using jQuery's ajaxSubmit function from the Forms
I have a form I am submitting via AJAX (using prototype and the built-in
Hey basically just having a little trouble with the following, submitting a message from
I am creating some functionality whereby upon submitting a form, a success message is
Don't know why this is happening, but after submitting a form via JS (using
I have the following error message in when submitting from my perforce client (p4v):

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.