Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with \n in mail() 1

Status
Not open for further replies.

frozenpeas

Technical User
Sep 13, 2001
893
CA
Hi,

The mail is sending fine but I am having trouble with the message formatting.

Here is what I have:

Code:
$mailcontent = 'The \n following \n account \n information was requested from '.$REMOTE_ADDR.'\n\n'
			   .'Username: '.$result['username'].'\n'
			   .'Password: '.$result['password'].'\n\n'
			   .'Have a nice day.\n\n';

But it comes through like this:

Code:
The \n following \n account \n information was requested from
123.456.78.9\n\nUsername: myself\nPassword: mypass\n\nHave a nice
day.\n\n

Thanks. frozenpeas
 
using single quotes won't expand variables or special characters... you need to put those \n's in double quotes.

-Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top