?
Solved

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

Posted on 2002-07-29
5
Medium Priority
?
193 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 600 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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

801 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