Jump to content

mail function forces wrap


silvano

Recommended Posts

When sending a mail, the mailer wraps the mail contents. In HTML5 there is a wrap="soft/hard" parameter which seems to do nothing. 

 

I collect a text via form/textarea, where the user may enter line breaks. If I print it, those are kept:

 

echo $myText;

 

produces:

 

This is line 1

This is line 2

 

However if I send it via mail:

 

 

$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
 
mail($to, $subject, $message, $headers);
 
then my text arrives like this:
 

This is line 1 This is line 2

 

What do I do wrong?

 

 
Link to comment
https://forums.phpfreaks.com/topic/281204-mail-function-forces-wrap/
Share on other sites

the PHPFreaks.com Questions, Comments, & Suggestions forum section, where you posted this -

This is NOT a help forum! Do not post topics asking for help that are not related to the website.

 

 

php help questions belong in the php help forum section. moving thread....

 

 

In HTML5 there is a wrap="soft/hard" parameter which seems to do nothing

 

Ah...no! If you want to create own html email template, you should code it like it's 1995-1996 :)

Coding an html email is basically like you're coding simple web page using old fashioned style.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.