Comments

  1. 28/01/10

    Good work! I think this could be made really useful by making it a more general function: something like (I’m just sketching the idea here)

    function send_html_and_text_email( $to, $from, $subject, $htmlContent, $textContent = ""){
    
    // $to could be an array or a single email, the function would be able
    // to deal with it using the is_array function
    
    // The text half of the email, if the parameter is empty, could be extracted
    // from the html content, by extracting everything between the <body> tags
    // with a regex and then running strip_tags on that
    
    }
    

    Like I say, it’s just a sketch, but could be a really useful library function :)

    Also, one thing I can’t help but note from your code is the mix of Camel Case and underscore convention for naming variables, sometimes even within the same identifier – that’s a bit mental :P

  2. admin
    28/01/10

    Looks great @Griff.
    Good call with those variables. I put the code together from various sources and that’s where the mixture of variables come from. Let me fix that.

Something is wrong? Have a better idea? Say it.

(wrapp your code snipets with language tags - Example: for javascript or jQuery use [js][/js], for html use [html][/html] you get the idea...)