I am trying to add a script from an older site that I have recently replaced with drupal. The script uses the php mail() function, but this doesn't seem to work within drupal.
So a little research I found that there is the drupal_mail() function, which I have had a little luck with. However I am running into two issues:
(1) I can't use this function to send a subject line with a dash in it. when I do have a subject line with a dash then drupal_mail() doesn't do anything
(2) I can't figure out how to cc or bcc one or several emails...I try to place it in the header but drupal_mail() sends the email but it doesn't go to any of the cc or bcc in the list
So my question is
(1) How do I use the php mail() function in drupal so that I don't have to completely rewrite my tiny script? Is this even possible to do?
(2) If I have no other options and I have to use the drupal_mail() option, then what do I need to do in order to fix any of my two issues above?
Thanks in advance!
Comments
I have used the php mail()
I have used the php mail() function many times from drupal sites... it seems to work fine for me. Here is an example where I use it to send a dealer order to the site's email address, then use it again to send a confirmation to the user (a "dealer"). Note that I used html in the document and so had to add some additional header info. Hopefully this formats okay...
Hey i did a tutorial on this
Hey i did a tutorial on this can be founSending HTML and Plain text Mail with Drupal 6d here:
Also to add cc, you can add these lines to the module found at the above link, add it to line 80:
$message['headers']['Cc] = 'cc@google.com'
$message['headers']['Bcc] = 'cc@google.com'