Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've just installed hMailServer and Thunderbird and managed to get them talking to each other.

When Thunderbird gets the message from the server (this is all running locally by the way), the subject displays in the list like it should but the body is blank.

Hitting Ctrl+U to bring up the source shows that the full message is there, its just not being displayed in the email client.

Having read around on the internet for a bit, I've already tried deselecting View -> Display Attachments Inline and toggling all options under View -> Message Body As -> *.

Included is the raw message with some parts removed for my own security.

Return-Path: xxxx@gmail.com
Received: from my-laptop ([127.0.0.1])
    by localhost
    ; Thu, 18 Nov 2010 17:49:45 -0500
Subject: =?utf-8?Q?Forgot_your_password_on_Localhost=3f?=
To: test@localhost
X-PHP-Originating-Script: 0:Email.php
User-Agent: CodeIgniter
Date: Thu, 18 Nov 2010 17:49:45 -0500
From: "Localhost" <xxxx@gmail.com>
Return-Path: <xxx@gmail.com>
Reply-To: "Localhost" <xxx@gmail.com>
X-Sender: xxx@gmail.com
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <4ce5ad89986bb@gmail.com>
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="B_ALT_4ce5ad89986c6"
This is a multi-part message in MIME format.
Your email application may not support this format.
--B_ALT_4ce5ad89986c6
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Hi username,
Forgot your password, huh? No big deal.
To create a new password, just follow this link:
http://localhost/auth/reset_password/2/3958e7dded143056d5224941f23e93eb
You received this email, because it was requested by a Localhost user. This
is part of the procedure to create a new password on the system. If you DID
NOT request a new password then please ignore this email and your password
will remain the same.
Thank you,
The Localhost Team
--B_ALT_4ce5ad89986c6
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.=
w3.org/TR/html4/loose.dtd">
<html>
<head><title>Create a new password on Localhost</title></head>
<body>
<div style=3D"max-width: 800px; margin: 0; padding: 30px 0;">
<table width=3D"80%" border=3D"0" cellpadding=3D"0" cellspacing=3D"0">
<tr>
<td width=3D"5%"></td>

<td align=3D"left" width=3D"95%" style=3D"font: 13px/18px Arial, Helvetica,=
 sans-serif;">
<h2 style=3D"font: normal 20px/23px Arial, Helvetica, sans-serif; margin: 0=
; padding: 0 0 18px; color: black;">Create a new password</h2>
Forgot your password, huh? No big deal.<br />
To create a new password, just follow this link:<br />
<br />
<big style=3D"font: 16px/18px Arial, Helvetica, sans-serif;"><b><a href=3D"=
http://localhost/auth/reset_password/2/3958e7dded143056d5224941f23e93eb"=
 style=3D"color: #3366cc;">Create a new password</a></b></big><br />
<br />
Link doesn't work? Copy the following link to your browser address bar:<br =
/>
<nobr><a href=3D"http://localhost/auth/reset_password/2/3958e7dded143056=
d5224941f23e93eb" style=3D"color: #3366cc;">http://localhost/auth/reset_=
password/2/3958e7dded143056d5224941f23e93eb</a></nobr><br />

<br />
<br />
You received this email, because it was requested by a <a href=3D"http://lo=
calhost/" style=3D"color: #3366cc;">Localhost</a> user. This is a part of t=
he procedure to create a new password on the system. If you DID NOT request=
 a new password then please ignore this email and your password will remain=
 the same.<br />
<br />
<br />
Thank you,<br />
The Localhost Team
</td>
</tr>
</table>
</div>
</body>
</html>

--B_ALT_4ce5ad89986c6--

Thank you ahead of time for whatever help you can give me.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

This is happening because you're missing a blank crlf to separate the headers from the body. Email messages follow the format:

Header1: blah\r\n
HeaderN: blah\r\n
\r\n
Body

I added \r\n for emphasis, but basically, you separate the headers from the content using a blank line (or, in essence, a double crlf). This, this area in your email would need to be changed:

Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="B_ALT_4ce5ad89986c6"
This is a multi-part message in MIME format.
Your email application may not support this format.
--B_ALT_4ce5ad89986c6

...and introduce a blank crlf...

Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="B_ALT_4ce5ad89986c6"

This is a multi-part message in MIME format.
Your email application may not support this format.
--B_ALT_4ce5ad89986c6

Hope this helps!

Andrew

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.