sender name is not used in mass contact submit script
in the "from" row is used only sender email

CommentFileSizeAuthor
#3 mass_contact-574482_3.patch678 bytesmrtoner

Comments

Wolfgang Reszel’s picture

Version: 5.x-2.5 » 6.x-1.x-dev

In 6.x you could change the code to the following:

<?php
  $from_email = ($form_state['values']['mail']) ? $form_state['values']['mail'] : variable_get('mass_contact_default_sender_email', '');
  if (!empty($from_name)) $from_email = "\"=?UTF-8?Q?".imap_8bit($from_name)."?=\" <$from_email>";
?>

The last line is added.

Wolfgang Reszel’s picture

Status: Active » Needs work

I think something like that should be added to the module. Or is there any reason not to do that?

mrtoner’s picture

Status: Needs work » Needs review
StatusFileSize
new678 bytes

Perhaps this will do it...

josh@pixael.com’s picture

thanks i'll try

sapox’s picture

#3 Seems to work quite OK for me.

oadaeh’s picture

Category: bug » feature
Status: Needs review » Needs work

There is a known problem on Windows servers with sending e-mail addresses the form of "First Last ". I will create another setting that allows the administrator to decide whether to include it or not and then just make it so.

oadaeh’s picture

carteriii’s picture

I've been running a variant of this for quite some time with no problem and it would be nice to see it merged in to the released code. Of course I mention this now because I just had to merge in my changes to the newly released version :=)

For what it's worth, I took the approach of adding a new variable, $from_name_and_email to make sure the meaning was clear:

Line 1328: $from_name_and_email = (!empty($from_name) ? '"' . $from_name . '" <' . $from_email . '>' : $from_email);

Then further below I modified all the calls to drupal_mail() or _mass_contact_mail() to use $from_name_and_email rather than simply $from_email.

Perhaps this could even be implemented as a preference such that someone could disable it if the "Name " format caused problems???

Anonymous’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev

Hi !

Here is my solution :

If Mime Mail is used, the following patch enables the from_name field. It should be inserted at line 473, just before the call to _mass_contact_prepare_bodies.

  // If Mime Mail is enabled, it is able to process an array for the from
  // name field.
  if (!empty($from_name) and module_exists('mimemail')) {
    $from_email = array('name' => $from_name, 'mail' => $from_email);
  }
oadaeh’s picture

@zigazou: That is not a patch, it's a code snippet. A patch is what is atached to comment #3. I can save that file that has the necessary control structure for automatically inserting the code into the existing file w/o me having to find the location in the file and copy and paste. Please read the page about patches I sent you in #1795322-1: User loses track of the selected categories if the module is configured to not include the category in the subject.

oadaeh’s picture

I've included a fix for this in the 7.x-1.x-dev branch, here: http://drupalcode.org/project/mass_contact.git/commit/189d4fb

Let me know if it works for you or not.

oadaeh’s picture

Status: Needs work » Fixed

I've included a fix for this in the 6.x-1.x-dev branch, here: http://drupalcode.org/project/mass_contact.git/commit/fd5b810

Let me know if that one works for you or not.

oadaeh’s picture

I should have said that in order to make this happen, I added an two administration items, disabeled by default, to allow the users' names (login IDs for the recipients) to be used in the from or to fields.

The settings are are in the "Include names with email addresses" fieldset on the "Message header" settings page.

For Drupal 6, that page is here: admin/build/mass_contact/settings/header
For Drupal 7, that page is here: admin/config/system/mass_contact/settings/header

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.