Plain text wrapping/line lengths
Moderators: Chris Corbyn, General Moderators
Plain text wrapping/line lengths
Hi everyone,
A question about line lengths on plain text versions of emails sent with swiftmailer. Thus far I don't have any line length stuff sorted out, and so when I send an email to my gmail account and then click "Message text garbled?" to display the plain text version, all the long lines extend far out past the width of my monitor.
Is it best for me to put in some code to wrap lines to 72 (?) characters before I actually transmit them, or is it just best to send the plain text versions with really long lines and then just let the client wrap them for display? (The fact that gmail doesn't do this, makes me think I should be doing the former).
I couldn't even test this in Outlook; how can i get the plain text version to display in Outlook 2003? If I open the email up (double click), and then choose the Format menu; it has the options for Plain Text and HTML greyed out, with a tick next to HTML; which indicates to me that outlook doesnt think there's a plain text version of the email present.
Any ideas?
Thanks heaps!
A question about line lengths on plain text versions of emails sent with swiftmailer. Thus far I don't have any line length stuff sorted out, and so when I send an email to my gmail account and then click "Message text garbled?" to display the plain text version, all the long lines extend far out past the width of my monitor.
Is it best for me to put in some code to wrap lines to 72 (?) characters before I actually transmit them, or is it just best to send the plain text versions with really long lines and then just let the client wrap them for display? (The fact that gmail doesn't do this, makes me think I should be doing the former).
I couldn't even test this in Outlook; how can i get the plain text version to display in Outlook 2003? If I open the email up (double click), and then choose the Format menu; it has the options for Plain Text and HTML greyed out, with a tick next to HTML; which indicates to me that outlook doesnt think there's a plain text version of the email present.
Any ideas?
Thanks heaps!
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
is there a recommended way to do this?
I've found this function:
http://www.weberdev.com/get_example-164.html
which looks like it'll do the trick. is there a better way?
cheers
I've found this function:
http://www.weberdev.com/get_example-164.html
which looks like it'll do the trick. is there a better way?
cheers
Sorry, cant add much in the way of a solution, but I reading your post, I just had to comment.
Outlook seems to ticks the version you are seeing, and wont let you change whether there is a text component or not.
If you're trying to test your emails for structure and mutipart views, move on up in the world and get yourself Thunderbird.
Source view is easily accessible, includes full headers and it allows switching between HTML and text parts with ease.
Ya know ... I found this too, and it is REALLY frustrating.I couldn't even test this in Outlook; how can i get the plain text version to display in Outlook 2003? If I open the email up (double click), and then choose the Format menu; it has the options for Plain Text and HTML greyed out, with a tick next to HTML; which indicates to me that outlook doesnt think there's a plain text version of the email present.
Outlook seems to ticks the version you are seeing, and wont let you change whether there is a text component or not.
If you're trying to test your emails for structure and mutipart views, move on up in the world and get yourself Thunderbird.
Source view is easily accessible, includes full headers and it allows switching between HTML and text parts with ease.
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
wordwrap()
Plain text emails can't use the <br /> line break. You must use word wrap and wrap to 70 characters with "\r\n" as the break.
Plain text emails can't use the <br /> line break. You must use word wrap and wrap to 70 characters with "\r\n" as the break.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Code: Select all
$message->setLineWrap(70);
//and/or
$part->setLineWrap(70);- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
I would assume they use wordwrap?d11wtq wrote:There are some constants to provide lengths of 70 and 1000 but they're not really useful anyway.Code: Select all
$message->setLineWrap(70); //and/or $part->setLineWrap(70);
I couldn't find your documentation for line wrapping, so I just use wordwrap manually.
That did the job! Thanks heaps!d11wtq wrote:Code: Select all
$part->setLineWrap(70);