Page 1 of 1

Message truncated. Is it a bug?

Posted: Thu Aug 02, 2007 3:34 am
by dinh
I tried to send a text email with SwiftMailer but most of my message has been truncated when reaching to receiver's mail box.

The message is like this:

Code: Select all

$message = 'Hello, [full_name] Thank you for joining the our Network!
 
 This message is being sent to [email].
 Please do not reply directly to this message.
 
 Here is the sign-in name you provided to our sign-in system:
 
 Sign-in Name: "[username]"';
The final message that can be read from receiver mailbox will be

Hello, [full_name] Thank you for joining the our Network!

All the rest is truncated.

If the message is

Code: Select all

$message = 'Hello, [full_name]
 
 Thank you for joining the our Network!
 
 This message is being sent to [email].
 Please do not reply directly to this message.
 

 Here is the sign-in name you provided to our sign-in system:
 
 Sign-in Name: "[username]"';
The final message that can be read from receiver mailbox will be

Hello, [full_name]

It seems that the newline characters make the difference. My code is no special at all.

Code: Select all

// Create the message
			$subject = 'Account activation';

			$message = new Swift_Message($subject, $message);
			
			$from    = "pcdinh@domain.com";
			$to      = $form->getValue('emailaddress');
			
			$swift->send($message, $to, $from);
I have tested on
+ Windows XP SP2
+ PHP 5.2.4.dev (lastest build)
+ CentOS 4.5 + PHP 5.2.4 dev (lastest build)
+ Remote MTA (SMTP server): Code-Crafters Ability Mail Server 1.20
+ Email content-type: text/plain


I have also tested my email message with Zend Mail. A longer text has been sent but the last part of the message has been truncated as if the message were exceeded the maximum bytes allowed. I can confirm that there is no maximum bytes constraint to email message on our server.

Could you kindly to tell me how to solve it?

Thanks

Dinh

Posted: Thu Aug 02, 2007 5:09 am
by Chris Corbyn
I think I've narrowed this down to a bug with people's text editors or databases:

See the last post in this thread: viewtopic.php?t=68249

Effectively, it appears that some text editors (this particular one was BBEdit) mangle the character encoding and finish up with NUL bytes in the text effectively meaning "End of document".

Could you forward me the exact script you're using so I can check it (not copied and pasted... I need the file itself chris@w3style.co.uk). If the problem is in your database there's not a lot I can look at however.