473,493 Members | 2,229 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Mail function breaking message

I have a survey form that I want mailed to the client. I've built the
message body as plain text and tested it by writing it to a file and
examining the file. It's being built correctly.

When I send it through mail by a command similar to:
mail($to, 'Survey Results', $msgBody, "From: xx*@yyy.com");

the message gets broken up. At periodic places in the file, I seea
"!" (without the quotes) being inserted and the text format is broken.
The only thing I can think of is some type of length restriction. The
message isn't super long, but it isn't short either.

Can anyone offer any help?
Jul 17 '05 #1
2 1515
On Sat, 5 Feb 2005, Michael Satterwhite wrote:
When I send it through mail by a command similar to:
mail($to, 'Survey Results', $msgBody, "From: xx*@yyy.com");

the message gets broken up. At periodic places in the file, I seea
"!" (without the quotes) being inserted and the text format is broken.
The only thing I can think of is some type of length restriction. The
message isn't super long, but it isn't short either.


I suspect the length of the individual lines in your message body, not the
message as a whole, is causing the problem. I believe lines longer than a
certain number of characters are truncated and an exclamation mark placed
at the end of the line. This happened to me once using the built-in mail
function with sendmail on a Linux box.

Since you say your message is plain text, try running it through wordwrap:
mail($to, 'Survey Results', wordwrap($msgBody), "From: xx*@yyy.com");

This splits the string on word boundaries so that each line is not longer
than 75 characters (by default).

--
Matt
Jul 17 '05 #2
Matt Raines wrote:
On Sat, 5 Feb 2005, Michael Satterwhite wrote:
When I send it through mail by a command similar to:
mail($to, 'Survey Results', $msgBody, "From: xx*@yyy.com");

the message gets broken up. At periodic places in the file, I seea
"!" (without the quotes) being inserted and the text format is broken.
The only thing I can think of is some type of length restriction. The
message isn't super long, but it isn't short either.


I suspect the length of the individual lines in your message body, not the
message as a whole, is causing the problem. I believe lines longer than a
certain number of characters are truncated and an exclamation mark placed
at the end of the line. This happened to me once using the built-in mail
function with sendmail on a Linux box.

Since you say your message is plain text, try running it through wordwrap:
mail($to, 'Survey Results', wordwrap($msgBody), "From: xx*@yyy.com");

This splits the string on word boundaries so that each line is not longer
than 75 characters (by default).


That was it. Thanks
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3313
by: Web Master | last post by:
Hi, I am having a little issue with Jacks Form mail php script. I have installed it and configured the form to get it to work, but for some bizarre reason I have 2 issues I can't seem to debug....
0
1442
by: Mail Delivery Subsystem | last post by:
This is a MIME-encapsulated message --Boundary_(ID_QHqg8WmB+CETJUVPdiYhDQ) Content-type: TEXT/PLAIN; CHARSET=US-ASCII Content-transfer-encoding: 7BIT The original message was received at Sun,...
8
5448
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
1
3245
by: oni | last post by:
hi all, the program should be able to log on to a pop mail account and need to just read its headers and display. any help in this regard highly apperecialted. code pref VB.NET thankz in...
4
1852
by: Brett | last post by:
I'd like any references to code that demonstrates how to download email messages from a mail server strictly through VB.NET. I'd also like to split each message into seperate components such as: ...
11
2013
by: johnbrown105 | last post by:
Hello All, I am doing another exercise (I repeat, *exercise*). The (irrelevant to this discussion) point is to show that "You can inject a friend declaration into a namespace by declaring it...
2
2659
by: Ruud | last post by:
Just before leaving for a holiday my collegue modified this script. Now it won't send any body text (The data filled in on the form) and in an error condition it won't send any attachments either....
1
6816
by: maxxxxel | last post by:
Hi Can anyone help me with some asp code , I changed the code to use CDO.message instead of the old cdont.sys to send mail from a ASP webpage which works fine. Our problem is that when we send...
7
16865
by: mukeshrasm | last post by:
Hi I am no able to send mail and it is giving this error Warning: mail(): SMTP server response: 530 5.7.3 Client was not authenticated in c:\inetpub\wwwroot\eshop\includes\classes\email.php on...
0
6989
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7195
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6873
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7367
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5453
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4579
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
644
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
285
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.