By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,747 Members | 2,011 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,747 IT Pros & Developers. It's quick & easy.

how to change the font style in php

P: 45
Hello My PHP code is

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. $headers .='From: support@epcindex.com';
  3.  
  4. $link = mysql_connect("localhost", "username", "pwd") or die                      
  5. ("Error connecting to mysql:");
  6.  
  7. mysql_select_db("dbname",$link) or die("Unable to select database: . mysql_error()");
  8.  
  9. $emailid = $_POST["EmailId"];
  10.  
  11. $result = mysql_query ("select Password from USER_ACCOUNT where EmailId = '$emailid' ");
  12. if($row = mysql_fetch_array($result)) 
  13. {
  14. $password = $row["Password"];
  15.  
  16. $row['body'] . " " . $row['emailid'];
  17. $row['emailid'] . " " . $row['Password'];
  18.  
  19. $body = 'Hi,<br /><br /> The requested Account Details:<br /><br />';
  20.  
  21. $result = mail($emailid,$body,$password,$headers);
  22. mysql_close($link);
  23. }
  24. ?>
This code is working but my problem is font style of the code.
In the Output we have the different font stlye, Emailid and Password are in one style and the body in another style.I want same font style for all the above.I easily change the body font style by using the <font style=" "></font>.But i don't know how to change the EmailId and Password font style.

Please any one help to solve the problem

Thanks in Advance,
Geethu.
Feb 19 '07 #1
Share this Question
Share on Google+
2 Replies


ak1dnar
Expert 100+
P: 1,584
Hi I think you need to send HTML email apart from PLAIN Text.
To send html formatted email via php mail() function you have to
put these headers with the other headers. this is not for PHP mail() actually,
this for your email client with out these headers your mail client
cant understand the html format . Try it and format the mail body as u wish by using html tags.

[php]
$headers .= 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
[/php]

:) get back for any doubts.
Feb 19 '07 #2

P: 45
Hi I think you need to send HTML email apart from PLAIN Text.
To send html formatted email via php mail() function you have to
put these headers with the other headers. this is not for PHP mail() actually,
this for your email client with out these headers your mail client
cant understand the html format . Try it and format the mail body as u wish by using html tags.

[php]
$headers .= 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
[/php]

:) get back for any doubts.

ok thank you for ur kind help
Feb 19 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.