Solved

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

Posted on 2002-07-29
5
191 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn how to count occurrences of each item in an array.
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 …

695 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