hey there -

While I've been using PHP for a while I'm fairly new to Drupal. I'm working on a project where I need to send articles in the system to specific users, however I need to send them as attachments. I have tried using the Send and MimeMail modules to accommodate this and the best it can do is send the article as an HTML email inline and mime encoded. However as I mentioned I need to send the article as an HTML file attachment along with any images in the article as attachments. I tried hacking both the Send module and MimeMail module to no avail. I also tried introducing the phpMailer class into the fray to no avail.

Has anyone done something similar that would be able to help out? I'm really at my wit's end plus I'm under the weather so everything seems a little more complicated than if I were otherwise healthy.

I'd appreciate any advice or support and would gladly pay to get this on track so that I can finish it by next week.

Please let me know if you can help along with your fee.

best regards,
brian

Comments

scrypter’s picture

You can't use drupal_mail for attachments. I have a module which sends me a .gz file via cron and it works fine. I based it on code I found by googling for php mail attachment. One problem I did have was to do with line breaks between php 4 and php 5. I had to use this:

  if (substr(PHP_VERSION, 0, 2) != '5.') { // this version seems to put in extra blank lines
    $one_blank = "\r\n";
    $two_blank = "\r\n\r\n";
  } else {
    $one_blank = "\n";
    $two_blank = "\n\r\n";
  }

PM me if you would like my code.

www.purpleoar.co.nz/scryptik - Javascript editor with syntax error checking
www.purpleoar.co.nz - Web development, Drupal consultancy

www.purpleoar.co.nz/scryptik - Javascript editor with syntax error checking
www.purpleoar.co.nz - Web development, Drupal consultancy