Solved

When using mail function, "!" is added to the results. Why?

Posted on 2002-07-29
5
186 Views
Last Modified: 2008-02-20
Greetings,

Over the past few months I've been increasing my use of the mail function in php. However, I'm finding a issue with the results (the e-mail that is recieved).

The e-mail returns "!" through out the text of the e-mail, which was not there when it was send.

Example:
My page i!s done.

Is there a way around this, or a way to remove the "!"?
0
Comment
Question by:Timelib
  • 3
  • 2
5 Comments
 

Expert Comment

by:diverdiver
ID: 7186365
An example of your mail function would help!

diverdiver
0
 
LVL 1

Author Comment

by:Timelib
ID: 7186638
The simple example I can give is this:

<?
$mail_body = "";
for ($i=0; $i <500; $i++) {
$mail_body .=
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<br>" . chr(13);
}    

$MailSubject = "Testing";

$msg = $mail_body;

$EmailAddress = "your@name.com";
$sender_email = "cbrady@sbccd.cc.ca.us";
$mailheaders = "From: \"Test Server\" <webmaster@name.com>\n";
$mailheaders .= "Reply-To: $sender_email\n";
$mailheaders .= "Content-Type: text/html\n";
mail($EmailAddress, $MailSubject, $msg, $mailheaders);

?>
0
 
LVL 1

Author Comment

by:Timelib
ID: 7186644
I've done a little more investigating and found that unix and windows handle file a little different.

For unix you need to use a "\n" or chr(10); which is a carrage return only.

For windows you need to use a "\r\n" or chr(13); which is a carrage return, new line.

I found the info on the following web page:
http://bugs.php.net/bug.php?id=13342

Easy 200 points, if you agree to this solution so I can close this question.
0
 

Accepted Solution

by:
diverdiver earned 200 total points
ID: 7186785
Agreed,

Will keep the page for reference.

diverdiver
0
 
LVL 1

Author Comment

by:Timelib
ID: 7186834
The proposed answer is above selected answer.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now