Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

636 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