Adding multiple values in the header
| Project: | Mime Mail |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
Jump to:
Hi, I'm by no means an expert at email, but my hand has been forced a little with this problem.
Basically, I needed to create a very custom email content update solution for a client. One of the reasons why was to address a performance issue regarding processing of the emails to users. I've found that the volume of emails to send, plus the volume of traffic on the site was often causing the server to go into swap, and die in the ass. So i thought of a solution that may, possibly, work.
Instead of calling mail() for every single person (ESPECIALLY when the email content is the same for each user), why not send the email to multiple addresses in the one hit, by using BCC?
See attached patch for code changes (It is against the 22-April-09 dev version).
You can still call mimemail() exactly as you have in the past, but with the patch you can also do this:
$headers = array(
'Bcc' => array(
'test@fake.com',
'drupal@is.awesome',
'one.more@to.go'
),
);
mimemail($sender, $recipient, $subject, $body, NULL, $headers);Hopefully im not dreaming.
| Attachment | Size |
|---|---|
| mimemail.patch | 1.65 KB |

#1
Going through the code a little more there are quite a few functions that play with the headers. If you guys think this avenue is worth pursuing, i'll write a helper function so this is easy to implement throughout the module.