Incoming mail to / / is visible in the webmail but doesn’t show up in the for Android app

I was developing a php script that should send emails to a receiver. It worked great with a number of email services, like gmail for example. But with, aka or the emails I sent to an account was only visible when logging in to the account through the web. If the same account was configured in the Android app the emails never showed up.

After some headscratching I found the reason. The problem was that my php script sent the emails using only html (Content-type: text/html; charset=utf-8 in the email headers). When the script was changed to send it as a multipart message, both html and text, the message showed up in the Android application also. Even though the Android app had no problems displaying the html-version of the email, it was just ignored if it wasn’t a multipart message with both html and text.

An example on how to send multipart emails in php can be found here.