I finally got it working if anyone is interested. I had to install another mail reader because Apple mail would not let me see either the error or the message. The problem turned out to be the extremely fussy way headers need to be set up (to a fault, IMO). It also was compounded by the way PHP ‘mail()’ works.
The spacing of headers and ‘boundry’ lines is critial (i.e. there cannot be a blank line between the ‘boundry’ line and the ‘content-type’ line and there MUST be a blank line between the ‘content-type’ line and text of that part of the body.
The crux of the problem was that the headers need to be terminated with ‘\r\n’ which I already knew. However, when the ‘boundry’ and ‘content-type’ are part of the body, the ‘\r\n’ is apparently not recognized by the ‘mail()’ function and thus not properly translated. The solution was to put chr(13) and chr(10) at the end of those lines when in the body.
Sheesh!
Comments are closed