5 Replies - 1146 Views - Last Post: 12 October 2007 - 02:45 AM Rate Topic: -----

#1 Yurasik  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 11-October 07

format problem in php/html

Posted 11 October 2007 - 06:11 AM

Hello,

I was using Cpanel ( Lunix Server ) and it was crashing all the time, I was offered to move to VDeck ( FreeBSD sister of lunix ).
To make long story short now I have a problems and I need your help with that.

That one is a minor but still a problem. I didn't have this before.
This is a text of email that my system generates after customer sign up and request services. There is problem in formatting new line and links.
==================================================================================================================
Dear irina,<br />
 
<br />
Thank you for creating an account with Total Care Cleaners. <br />
 
You can update your account anytime from the <a href=http://www.totalcarecleaners.com/login_now.php >Login Area</a> <br />
 
<br />
Login ID : 6512281348<br />
 
Password : irina<br />
 
<br />
 
Best Wishes <br />
 
<a href=http://www.totalcarecleaners.com>Total Care Cleaners</a> <br />
 
Customer Support Team <br />


==================================================================================================================

This is a piece of code from *.php file that generate this email.

==================================================================================================================
$mybody2  = "Dear ".$Fname.",\r\n\n";
 
 $mybody2 .= "Thank you for creating an account with Total Care Cleaners. \r\n";	 
 
 $mybody2 .= "You can update your account anytime from the <a href=http://www.totalcarecleaners.com/login_now.php >Login Area</a> \r\n\n";		   
 
 $mybody2 .= "Login ID : ".$Phone. "\r\n";
 
 $mybody2 .= "Password : ".$Password. "\r\n";	  
 
 $mybody2 .= "\r\n";	  
 
 $mybody2 .= "Best Wishes \r\n";	 
 
 $mybody2 .= "<a href=http://www.totalcarecleaners.com>Total Care Cleaners</a> \r\n";	 
 
 $mybody2 .= "Customer Support Team \r\n";
 

==================================================================================================================

Please tell me what we're doing wrong.

Thanks

Is This A Good Question/Topic? 0
  • +

Replies To: format problem in php/html

#2 PennyBoki  Icon User is offline

  • system("revolution");
  • member icon

Reputation: 53
  • View blog
  • Posts: 2,334
  • Joined: 11-December 06

Re: format problem in php/html

Posted 11 October 2007 - 10:56 AM

Hi Yurasik, welcome :)
You may want to post this question in the PHP forum.
Was This Post Helpful? 0
  • +
  • -

#3 jjhaag  Icon User is offline

  • me editor am smartastic
  • member icon

Reputation: 44
  • View blog
  • Posts: 1,789
  • Joined: 18-September 07

Re: format problem in php/html

Posted 11 October 2007 - 12:24 PM

welcome to </DIC>, Yurasik. glad you could join us.

-jjh
Was This Post Helpful? 0
  • +
  • -

#4 Thorian  Icon User is offline

  • Pirate Medic
  • member icon

Reputation: 22
  • View blog
  • Posts: 5,904
  • Joined: 06-June 02

Re: format problem in php/html

Posted 11 October 2007 - 12:33 PM

Gimme a few minutes ill clean this post up and move it.

Code tags are your friend my friend.

Yuck
Was This Post Helpful? 0
  • +
  • -

#5 snoj  Icon User is offline

  • Married Life
  • member icon

Reputation: 84
  • View blog
  • Posts: 3,564
  • Joined: 31-March 03

Re: format problem in php/html

Posted 11 October 2007 - 03:01 PM

What function are you using to send the message? Are you sending it as HTML or plain text?
Was This Post Helpful? 0
  • +
  • -

#6 fxitsolutions  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 31
  • Joined: 01-October 07

Re: format problem in php/html

Posted 12 October 2007 - 02:45 AM

You need to add HTML headers to your PHP mail() function.

$headers = "MIME-Version: 1.0\n";
$headers .= "Content-Type: text/HTML; charset=ISO-8859-1\n";
$headers .= "X-Priority: 3\n";
$headers .= "X-MSmail-Priority: Normal\n";
$headers .= "X-mailer: php\n";

mail($to, $subject, $message, $headers);



This will send your mail in HTML format instead of plain text (which is why links and line breaks do not get parsed).
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1