<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Shut up I'm sick of your stupid emails!!!!<br><br><div style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.292969); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); font-family: Helvetica; font-size: medium; -webkit-text-size-adjust: auto; "><br></div></div><div><br>On Dec 29, 2013, at 6:47 PM, Rob Thorne <<a href="mailto:rob@torenware.com">rob@torenware.com</a>> wrote:<br><br></div><div><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1">I don't see anything obviously wrong in your sample, but after comparing your implementation with mine from a recent project, I see a couple of differences:<div><br></div><div>1. You mention using the mimemail module, but are you also using the mailsystem module? The simplest explanation would be that mimemail is not getting invoked at all.</div><div>2. If I recall correctly, some fields you can set in the "message" array upstream can get unset before hook_mail is called for you. So you may need to put these items into your "params" array and hammer them in as part of your hook_mail implementation. My code looks like this:</div><div><br></div><div>Sending the mail:</div><div><br></div><div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><div> $mail_params = array(</div><div> 'subject' => $settings['subject'],</div><div> 'message' => $settings['message'],</div><div> 'headers' => array(</div><div> 'Content-Type' => 'text/html; charset=UTF-8'</div><div> ),</div><div> 'attachments' => $attachments,</div><div> 'voter' => $credit_app,</div><div> );</div><div> $mail_params['plain'] = FALSE;</div><div> $mail_params['plaintext'] = $mail_params['message'];</div><div> if (!empty($settings['bcc'])) {</div><div> $mail_params['headers']['Bcc'] = $settings['bcc'];</div><div> }</div><div> </div><div> $message = drupal_mail('mymodule', 'send-test', $address, $language, $mail_params, $from);</div></div><div><br></div></blockquote></div><div>In my hook_mail implementation:</div><div><br></div><div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><div> switch ($key) {</div><div> case 'send-test':</div><div> $message['subject'] = $params['subject'];</div><div> $message['body'][] = $params['message'];</div><div> $message['headers'] = array_merge($message['headers'], $params['headers']);</div><div> break;</div><div> } </div></div><div><br></div></blockquote></div><div>Note also that I'm setting some parameters that you are not setting ('plain', 'plaintext'); I believe I added those after debugging the problem you're having here.</div><div><br></div><div>Hope this helps,</div><div><br></div><div>Rob</div><div><br><div>
<div>Rob Thorne</div><div>Torenware Networks</div><div><br></div><br class="Apple-interchange-newline">
</div>
<br><div><div>On Dec 29, 2013, at 12:50 PM, Muzaffer Tolga Ozses <<a href="mailto:tolga@ozses.net">tolga@ozses.net</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div class="gmail_default" style="font-family:courier new,monospace">Hi,<br></div><div class="gmail_quote"><div dir="ltr"><div style="font-family:'courier new',monospace"><br></div><div style="font-family:'courier new',monospace">
I keep developing my module, and inside it I am sending e-mail. I am also trying to attach a file, to no avail. I have installed mimemail, I have changed mime type in my code, I have dpm'd everything. dpm gives me correct values, and the subject and body of the e-mail come through, but I couldn't get file attachment to work at all. What else can I do?</div>
<div style="font-family:'courier new',monospace"><br></div><div style="font-family:'courier new',monospace">Regards,</div><div style="font-family:'courier new',monospace">
<br></div><div style="font-family:'courier new',monospace">PS: You can see the code at <a href="http://drupalcode.org/sandbox/Kartagis/1543120.git/blob/da47378:/pass2pdf.module#l69" target="_blank">http://drupalcode.org/sandbox/Kartagis/1543120.git/blob/da47378:/pass2pdf.module#l69</a></div>
</div>
</div><br></div>
</blockquote></div><br></div></div></body></html>