473,545 Members | 2,113 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Losing random characters in HTML email

,hj

From: ",hj" <we*******@mail .com>
Subject: Losing random characters in HTML email
Date: 28 November 2003 17:21

I've narrowed down my code as much as I can so that I can show you this bug.
The reason the a's are there and not removed is because if I remove them the
problem doesn't show itself. It seems that there is a pattern and the nth
character does not show. Weird stuff.
<?php
$content = '

<html>
<head>
<title>aaaaaa a :: title</title>
<META http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<META name="Descripti on" content="aaaaaa r -
aaaaaaaaaaaaaaa aaaaaaaaaaaaaaa aaaaaaaaaaaaaaa aaaaaaaaaaa
aaaaaaaaaaaaaaa aaaaaaaaaaaaaaa aaaaaaaaaaaaaaa aaaaaaaaaaae.">
<META name="Keywords"
content="aaaaaa aaaaaaaaaaaaaaa aaaaaaaaaaaaaaa aaaaaaaaaaaaaa
aaaaaaaaaaaaaaa aaaaaaaaaaaaaaa aaaaaaaaaaaaaaa aaaaaaaaaaaaaaa aaaaa
aaaaaaaaaaaaaaa aaaaaaaaaaaaaaa aaaaaaaaaaaaaaa aaaaaaaaaaaaaaa aaaaaaaaaaaaaaa a
aaaaaaaaaaaaaaa aaaaaaaaa
aaaaaaaaaaaaaaa aaaaaaaaaaaaaaa aaaaaaaaaaaaa
aaaaaaaaaaaaaaa aaaaaaaaaaaaaaa aaaaaaaaaaaaaaa aaaaaaaaaaaaaa
aaaaaaaaaaaaaaa aaaaaaaaaaaaaaa aaaaaaaaaaaaaaa aaaaaaaaaaaaaaa aaaaaaaaaaaaaaa a
aaaaaaaaaaaaaaa aaaaaaaaa
aaaaaaaaaaaaaaa aaaae">
<LINK rel="stylesheet "
href="aaaaaaaaa aaaaaaaaaaaaaaa aaaaaaaaaaaaaaa aaaaaaaaaaaa" type="text/css">
</head>
<body>
contentdfdfdf
</body>
</html>';
$header = "Return-Path: fa****@aaaaaaa. com\r\n";
$header .= "From: Gamblar <ac******@aaaaa aa.com>\r\n";
$header .= "Content-Type: text/html;
charset=iso-8859-1;\r\n\r\n";

mail("we******* @aaaaaaaaaaa.co m","ac******@aa aaaaa.com",$con tent,$header);
?>

Try that code, changing the first mail attribute to your email address. You
should get this output: "contentdfd fdf </html".

Does anyone know what I'm doing wrong? Bug, perhaps?

Thanks in advance,

Keiron


Jul 17 '05 #1
4 3915
,hj wrote:
I've narrowed down my code as much as I can so that I can show you this bug.
The reason the a's are there and not removed is because if I remove them the
problem doesn't show itself. It seems that there is a pattern and the nth
character does not show. Weird stuff.
[big snip]
<body>
contentdfdfdf
</body>
[...]
mail("we******* @aaaaaaaaaaa.co m","ac******@aa aaaaa.com",$con tent,$header);
?>

Try that code, changing the first mail attribute to your email address. You
should get this output: "contentdfd fdf </html".
I get the full HTML (without headers).
When I try to view that HTML in my browser I see "contentdfdfdf" , but I
didn't look at the source then
Does anyone know what I'm doing wrong? Bug, perhaps?


Well ... "contentdfd fdf" *is* the body of that HTML.
What did you expect to see?
--
--= my mail address only accepts =--
--= Content-Type: text/plain =--
--= Size below 10K =--
Jul 17 '05 #2

",hj" <we*******@mail .com> wrote in message
news:bq******** **@titan.btinte rnet.com...

From: ",hj" <we*******@mail .com>
Subject: Losing random characters in HTML email
Date: 28 November 2003 17:21

I've narrowed down my code as much as I can so that I can show you this bug. The reason the a's are there and not removed is because if I remove them the problem doesn't show itself. It seems that there is a pattern and the nth
character does not show. Weird stuff.
<?php
$content = '

<html>
<head>
<title>aaaaaa a :: title</title>
<META http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<META name="Descripti on" content="aaaaaa r -
aaaaaaaaaaaaaaa aaaaaaaaaaaaaaa aaaaaaaaaaaaaaa aaaaaaaaaaa
aaaaaaaaaaaaaaa aaaaaaaaaaaaaaa aaaaaaaaaaaaaaa aaaaaaaaaaae.">
<META name="Keywords"
content="aaaaaa aaaaaaaaaaaaaaa aaaaaaaaaaaaaaa aaaaaaaaaaaaaa
aaaaaaaaaaaaaaa aaaaaaaaaaaaaaa aaaaaaaaaaaaaaa aaaaaaaaaaaaaaa aaaaa
aaaaaaaaaaaaaaa aaaaaaaaaaaaaaa aaaaaaaaaaaaaaa aaaaaaaaaaaaaaa aaaaaaaaaaaaaaa a aaaaaaaaaaaaaaa aaaaaaaaa
aaaaaaaaaaaaaaa aaaaaaaaaaaaaaa aaaaaaaaaaaaa
aaaaaaaaaaaaaaa aaaaaaaaaaaaaaa aaaaaaaaaaaaaaa aaaaaaaaaaaaaa
aaaaaaaaaaaaaaa aaaaaaaaaaaaaaa aaaaaaaaaaaaaaa aaaaaaaaaaaaaaa aaaaaaaaaaaaaaa a aaaaaaaaaaaaaaa aaaaaaaaa
aaaaaaaaaaaaaaa aaaae">
<LINK rel="stylesheet "
href="aaaaaaaaa aaaaaaaaaaaaaaa aaaaaaaaaaaaaaa aaaaaaaaaaaa" type="text/css"> </head>
<body>
contentdfdfdf
</body>
</html>';
$header = "Return-Path: fa****@aaaaaaa. com\r\n";
$header .= "From: Gamblar <ac******@aaaaa aa.com>\r\n";
$header .= "Content-Type: text/html;
charset=iso-8859-1;\r\n\r\n";

mail("we******* @aaaaaaaaaaa.co m","ac******@aa aaaaa.com",$con tent,$header);
?>

Try that code, changing the first mail attribute to your email address. You should get this output: "contentdfd fdf </html".

Does anyone know what I'm doing wrong? Bug, perhaps?

Thanks in advance,

Keiron


You wouldn't happen to be using PHP version 4.3.3 would you?

I had problems with random characters disappearing when using the mail()
function to send MIME encoded emails. This mail() bug has been reported at
the www.php.net website, it seems to have been fixed in 4.3.4.
Jul 17 '05 #3
Richard Hockey wrote:
You wouldn't happen to be using PHP version 4.3.3 would you?

I had problems with random characters disappearing when using the mail()
function to send MIME encoded emails. This mail() bug has been reported at
the www.php.net website, it seems to have been fixed in 4.3.4.


http://bugs.php.net/bug.php?id=26061

Seems it only happens in Windows and with php 4.3.3
I have php 4.3.3 but not Windows; no wonder I couldn't reproduce the
error!
--
--= my mail address only accepts =--
--= Content-Type: text/plain =--
--= Size below 10K =--
Jul 17 '05 #4
Hello,

On 11/28/2003 05:21 PM, ,hj wrote:
Try that code, changing the first mail attribute to your email address. You
should get this output: "contentdfd fdf </html".

Does anyone know what I'm doing wrong? Bug, perhaps?


First, you should never send HTML only (Content-type: text/html)
messages. Many spam filters will discard your message. You should at
least have an alternative text part (text/plain). For that you should be
sending multipart/alternative messages, that include both the text and
HTML parts and let the end user program read what it can display better.

Second, you should always use an encoding method if you may have 8 bit
characters in your messages. For plain text or HTML, quoted-printable is
more appropriate.

Third, the mail() function has several bugs that is often better to
avoid it.

To solve any of these problems, you may want to try this class that
comes with sub-classes for deliverying messages via mail() but also via
sendmail/qmail/postfix/etc programs or even via SMTP.

http://www.phpclasses.org/mimemessage
--

Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/

Jul 17 '05 #5

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

Similar topics

12
9674
by: bhennon | last post by:
Hey all, I have a small php script that calls a random image at the following page. http://www.2006ymcanationals.com/random.php IT WORKS IF I go directly to the above link. I am trying to call that in another page so that i get a random image the page is http://2006ymcanationals.com/index.php using <img
6
2566
by: Jean-Fran?ois Lacrampe | last post by:
Hello, I've got two random number/statistics questions I'd like you to review. My first question is not directly related to PHP, but will be implemented in PHP, as explained in my second question, so let's go: I want to generate 10000 strings of x characters, with one chance (or less) on a million that you can guess them by just randomly...
21
23104
by: Andreas Lobinger | last post by:
Aloha, i wanted to ask another problem, but as i started to build an example... How to generate (memory and time)-efficient a string containing random characters? I have never worked with generators, so my solution at the moment is: import string import random random.seed(14)
5
8518
by: Alistair | last post by:
Hello folks... this is my first post in here. I'm new to ASP having done all my previous work in Flash and bog standard HTML. Only been learning for a couple of weeks. anyway...I have been building a guestbook type page, but as with quite a lot of guestbooks and stuff some of the comments that get placed are not exactly suitable, and...
23
4152
by: Thomas Mlynarczyk | last post by:
I remember there is a programming language where you can initialize the random number generator, so that it can - if you want - give you the exactly same sequence of random numbers every time you initialize it with the same parameter. Can this be done with JavaScript? I couldn't find anything in the documentation. Basically, what I want to...
11
3763
by: anony | last post by:
Hello, I can't figure out why my parameterized query from an ASP.NET page is dropping "special" characters such as accented quotes & apostrophes, the registered trademark symbol, etc. These symbols insert without problem from query analyzer, so that suggests it's something within ASP.NET. I've tried using .NET textbox web controls as well...
0
1206
by: Adam Carpenter | last post by:
Hello, I am having some problems with these functions which are to be part of the forgotten password system for a website. I am sure it is something simple but I can't see it. I would be grateful for any help anyone could offer. The plan is: The users forgets their password so they enter their email address together with responses to some...
7
2013
by: teh.sn1tch | last post by:
I created a random number generator for an application that uses a MersenneTwister class I found on the net. Basically I generate two random numbers from the MersenneTwister class and use each one as a seed for the built in Random class of the .net framework. To better illustrate I am prodviding the complete code for this application, it...
4
1988
n8kindt
by: n8kindt | last post by:
ok, i've done quite a bit of research on my problem here. random "! " will appear in my email that i'm sending thru cdo. i've learned that this problem occurs when there are long lines of html (or rich text in my case) of 512 characters or more. i've found multiple places that state the following: "We have identified errors occurring in Outlook...
0
7468
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, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7401
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7656
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7808
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...
1
7423
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...
0
5972
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5329
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...
0
4945
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...
0
3450
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...

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.