I have been struggling with trying to send an email with an attachment using PHP. It used to work but the message body was scrambled. Now I have got the message body to work but
I would suggest looking at phpmailer if you want to do complex email.