473,761 Members | 6,993 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

70 characters limit when sending mails

Hello,

I have built a "contact us" form on my Web site and am using the PHP
mail() function to send an e-mail to the Webmaster (that's me :-))
Everything works fine. What I would like to know however is whether it
is always necessary to limit each line of the message to 70 characters,
as is written in the documentation of the function (writing for
instance $this->message = wordwrap($messa ge, 70)).
It seems to work fine without doing it in my case and the text is
easier to read.
I guess there must be a reason for the limit, but how to find out when
it is needed?

Mar 3 '06 #1
5 4301
woof wrote:
Hello,

I have built a "contact us" form on my Web site and am using the PHP
mail() function to send an e-mail to the Webmaster (that's me :-))
Everything works fine. What I would like to know however is whether it
is always necessary to limit each line of the message to 70 characters,
as is written in the documentation of the function (writing for
instance $this->message = wordwrap($messa ge, 70)).
It seems to work fine without doing it in my case and the text is
easier to read.
I guess there must be a reason for the limit, but how to find out when
it is needed?


It's probably because your email program (Outlook, Thunderbird, etc.) is
set up to wrap text at 70 characters. Mine is, but I can disable it.

No RFC about it, AFAIK - just the email program's attempt to keep long
lines from wrapping off the end of the screen.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Mar 4 '06 #2
woof wrote:
Everything works fine. What I would like to know however is whether it
is always necessary to limit each line of the message to 70 characters,
as is written in the documentation of the function (writing for
instance $this->message = wordwrap($messa ge, 70)).


RFC 822 (Standard for the Format of ARPA Internet Text Messages) and its
successor RFC 2822 (Internet Message Format) say:

| There are two limits that this standard places on the number of
| characters in a line. Each line of characters MUST be no more than
| 998 characters, and SHOULD be no more than 78 characters, excluding
| the CRLF.

In practice, it is *sometimes* safe to ignore this.

However, tf you want to allow long lines, there are smarter ways of doing
this rather than just ignoring the RFCs. For example, you could try using
one of the MIME encoding options provided by PHP.

e.g.

$msgenc = base64encode($m essage);
$hdrs = "Content-Type: text/plain\r\n"
. "Content-Transfer-Encoding: base64\r\n";
mail($to, $subject, $msgenc, $hdrs);

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

Mar 4 '06 #3
Thank you Toby.
I understand that encoding the message would enable me to send the
message without having to worry about the recommended 70-characters per
line limit, right?
However, if I write
$msgenc = base64encode($m essage);
the email received is encoded (in other terms not decoded by Outlook
Express on my PC).
Is adding
Content-Transfer-Encoding: base64
sufficient?

Mar 4 '06 #4
woof wrote:
I understand that encoding the message would enable me to send the
message without having to worry about the recommended 70-characters per
line limit, right?
Yep.
However, if I write
$msgenc = base64encode($m essage);
the email received is encoded (in other terms not decoded by Outlook
Express on my PC).
Is adding
Content-Transfer-Encoding: base64
sufficient?


You'll also want "Content-Type:text/plain" and "MIME-Version:1.0" headers.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

Mar 6 '06 #5
That's pretty clear. Thanks again.

Mar 7 '06 #6

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

Similar topics

8
6520
by: Good Man | last post by:
Hi I'm building a 'job posting' site of sorts. When a job is available in a particular state, I want the system to send an email to everyone who is 'watching' that state. I know how to do this, but I need to figure out a way to 'send the emails in the background' - ie: if an administrator adds a job to Wyoming, I don't want them to have to wait for the php script to finish selecting and e-
10
4987
by: Stuart Mueller | last post by:
I have an exchange server, that I sometimes use to perform mail shots to clients on our database, these can be upwards of 1000 at a time. As we don't want different clients to see who we are working with we put these mailshots in the bcc field of the mails. This can sometimes cause a problem as we are getting alot of mails bounced back. I would like to write a script to have these emails sent out individually using the to: field of the...
3
6271
by: martin smith | last post by:
Here's the scenario. I'm currently using cdosys/asp to send mail to our SMTP server. We use a product called MailFilter to check for SPAM. It doesn't work very well. If MailFilter isn't working cdosys also has problems and emails don't get sent. As these email are confirmations for customer's bookings this means lots of customers calling to see where their confirmation emails have gone. The root of the problem is MailFilter but that here...
7
3521
by: Lau | last post by:
I need to send 1000 emails from an asp.net website. Normally I would use System.Web.Mail.MailMessage() to send thru an SMTP server. But the large amount of emails results in a timeout. My server administrator told me to write the emails to the “pickup directory” instead. I know that JMail can do this in ASP, but how do you do this in asp.net? -- --------------------
2
1150
by: Mariame | last post by:
Hi Everyone, im sending mails using this code Dim smtpmail As Mail.SmtpMail Dim msgRequest As New Mail.MailMessage msgRequest.BodyFormat = Mail.MailFormat.Html msgRequest.Subject = "Track"
5
1529
by: cashdeskmac | last post by:
I am writing a web application will will be hosted on a few peoples laptops as a local application. It will send e-mails once the user connects to the internet. How can I set up the "Mail.From" field if I don't know the address of the user's laptop? I have managed to get it working on my own machine, but setting the "From" filed to "Localhost" doesn't seem to work. Any suggestions?
8
2848
by: Michel Posseth [MCP] | last post by:
Hi does someone has experience with this ?? i have made a lot of apps in the past that were capable of sending e-mails the server i then talked to was a Linux SMTP server and it worked great Now i work in a company with a MS exchange server and would like to send some e-mails however i can`t get it to work at all error is : ( translated form the dutch language )
2
1389
by: srinivaspnv21 | last post by:
hi every one, plz help me out, i have to send mails from my asp.net page.... I have tried a code where mails are going only to gmail users the code is ... namespace: using System.Web.Mail; protected void btnSend_Click(object sender, EventArgs e) {
5
1405
by: ravitunk | last post by:
hello all....i have the following code in my ASP.net(C#) page to send an email... MailMessage mm = new MailMessage(); StringWriter sw = new StringWriter(); HtmlTextWriter ht = new HtmlTextWriter(sw); ht.RenderBeginTag("html"); ht.RenderBeginTag("head"); ht.RenderBeginTag("title"); ht.Write("Thank you"); ht.RenderEndTag();
0
9554
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
9988
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9923
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8813
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 projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7358
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6640
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5266
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3911
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2788
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.