473,326 Members | 2,099 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Sending HTML e-mail with PHP

:confused: Allo buddy does any one know how ti fix this.. I was sent email using mail(...) and the message email was succesed, but when the server in my Internet Provider has trouble.... the message email successed but have a problem like this

Mailer: PHP
X-Priority: 3
Content-Type: text/html; charset=iso-8859-1


<table align=center width=90%>
<tr><td>
<div align=justify>
Dear Member<br><br>
Thank you for your support towards b2b Indonesia. <br><br>

The message not like HTML its just text...

thanks :)
Jan 27 '06 #1
2 3217
Niheel
2,460 Expert Mod 2GB
Common problem.

PHP's mail function does not setup HTML mail for you automatically. No need to worry though. There are many open source classes out there that can help you extend the functionality of the mail() function.

Here is my favorite.
http://phpmailer.sourceforge.net/

Read through the tutorial, exmpales and documentation to get the best usage out of it.
Using HTML E-mail: http://phpmailer.sourceforge.net/tutorial.html#4

~ KUB

PS. Thanks for joining our community!
Feb 3 '06 #2
if u did not configure the localhost to server then it will not work .
upload it at server then plz check . thanks
Expand|Select|Wrap|Line Numbers
  1. <?php 
  2. if(!(isset($_SESSION['login'])))
  3. {
  4. header("location:login.php");
  5. }
  6.  
  7. if((isset($_POST['fullName'])))
  8.         {
  9.         $fname=$_POST['fullName'];
  10.         $country=$_POST['country'];
  11.         $email=$_POST['email'];
  12.         $subject=$_POST['subject'];
  13.         $comments=$_POST['mailMessage'];
  14.         $headers = "From: $fname";
  15.         $msg="\n Name:$fullname \n From:$email \n Country:$country \n Subject:$subject\n Message:\n  $comments \n feed back from site Digitizing Zone.";
  16.         mail("qaiserE628@gmail.com", $subject, $msg,$headers);
  17.         $msg="Thank you for your feedback. Your message has been sent.";
  18.         }
  19.  
  20. ?>
  21.  
  22. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  23. <html xmlns="http://www.w3.org/1999/xhtml">
  24. <head>
  25. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  26. <link type="text/css" href="style/style-members.css" rel="stylesheet" />
  27. <title>Member Login</title>
  28. <style type="text/css">
  29. <!--
  30. .style1 {color: #FF0000}
  31. -->
  32. </style>
  33. <script type="text/javascript">
  34.  
  35. function validateform(myform)
  36. {
  37.  
  38.  
  39.  
  40. if(myform.fullName.value=="" || myform.fullName.value=="Name:")
  41.  {
  42.  
  43.  alert("- Name cannot be empty");
  44.  myform.fullName.focus();
  45.  return false;
  46.  }
  47. if(myform.country.value=="" || myform.country.value=="Country:" )
  48.  {
  49.  
  50.  alert("- Company cannot be empty");
  51.  myform.company.focus();
  52.  return false;
  53.  }
  54.  
  55. if(myform.subject.value=="" || myform.subject.value=="Subject:")
  56.  {
  57.  
  58.  alert("- Subject cannot be empty");
  59.  myform.subject.focus();
  60.  return false;
  61.  }
  62.  
  63. if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myform.email.value)){
  64.  
  65. return true;
  66. }
  67. else
  68. {
  69. alert("Invalid E-mail Address! Please re-enter.");
  70. return (false);
  71. }
  72. return true;
  73. }
  74.  
  75. function clearFun(clr)
  76. {
  77. clr.value="";
  78. }
  79. function gourl()
  80. {
  81. window.location="user.php";
  82. }
  83.  
  84.  
  85.  
  86. </script>
  87. </head>
  88. <body>
  89.  
  90.     <?php include("includes/uppernav-member.php");?>
  91.     <div id="mainbody">
  92.     <table width="780" border="0" cellpadding="0" cellspacing="0">
  93.   <tr>
  94.     <td>
  95.     <table border="0" cellpadding="0" cellspacing="0" width="100%" style="font:Verdana, Arial, Helvetica, sans-serif;
  96.     font-size:18px; font-weight:bold;">
  97.     <tr><td height="4px" >&nbsp;</td></tr>
  98.     <tr>
  99.                                   <td colspan="3" align="center" class="td_class">E-mail us</td>
  100.       </tr>
  101.     <tr>
  102.       <td height="41" style="text-align:center; font-family:Verdana, Arial, Helvetica, sans-serif;
  103.       font-size:10px;"><?=$msg;?></td>
  104.     </tr>
  105.     </table>     
  106.  
  107.      </td>
  108.   </tr>
  109. </table>
  110.  
  111.                   <table width="283" border="0" align="center" cellpadding="0" cellspacing="0">
  112. <form name="form1" method="post" action="emailus.php" id="contactForm" onSubmit="return validateform(this);">                    
  113.                     <tr height="30">
  114.                       <th width="5" scope="row" ></th>
  115.                       <th width="25" scope="row" ></th>
  116.                       <td width="233" height="30"><label>
  117.                       <input name="fullName" type="text"  onfocus="clearFun(this);"  value="Name:" size="30" />
  118.                       </label></td>
  119.                       <td width="20" rowspan="9" align="left">&nbsp;</td>
  120.                     </tr>
  121.                     <tr height="30">
  122.                       <th scope="row"></th>
  123.                       <th scope="row"></th>
  124.                       <td><label>
  125.                         <input name="country" type="text"  onfocus="clearFun(this);" value="Country:" size="30" />
  126.                       </label></td>
  127.                     </tr>
  128.                     <tr height="30">
  129.                       <th scope="row"></th>
  130.                       <th scope="row"></th>
  131.                       <td><label>
  132.                         <input name="email" type="text"   onfocus="clearFun(this);" value="Email:" size="30" />
  133.                       </label></td>
  134.                     </tr>
  135.                     <tr height="30">
  136.                       <th scope="row"></th>
  137.                       <th scope="row"></th>
  138.                       <td><label>
  139.                         <input name="subject" type="text"   onfocus="clearFun(this);" value="Subject:" size="30"/>
  140.                       </label></td>
  141.                     </tr>
  142.                     <tr>
  143.                       <th scope="row"></th>
  144.                       <th height="30" scope="row"></th>
  145.                       <td class="style1 style2">Comments</td>
  146.                     </tr>
  147.                     <tr>
  148.                       <th scope="row"></th>
  149.                       <th height="50" scope="row"></th>
  150.                       <td><label>
  151.                         <textarea name="mailMessage" cols="150" rows="100" style="width:200px; height: 160px;  overflow: auto;" onfocus="clearFun(this);"></textarea>
  152.                       </label></td>
  153.                     </tr>
  154.                     <tr>
  155.                       <th scope="row">&nbsp;</th>
  156.                       <th scope="row">&nbsp;</th>
  157.                       <td>&nbsp;</td>
  158.                     </tr>
  159.                     <tr>
  160.                       <th scope="row">&nbsp;</th>
  161.                       <th scope="row">&nbsp;</th>
  162.                       <td>
  163.                         <input type="submit" name="Submit" value="Send" style="height:25px; width:95px;"/>
  164.                         <input type="reset" name="Submit2" value="Reset" style="height:25px; "/>
  165. </td>
  166.                     </tr>
  167.                     <tr>
  168.                       <th scope="row">&nbsp;</th>
  169.                       <th scope="row">&nbsp;</th>
  170.                       <td>&nbsp;</td>
  171.                     </tr>
  172.                           </form>
  173.                     <tr>
  174.                       <th scope="row">&nbsp;</th>
  175.                       <th scope="row">&nbsp;</th>
  176.                       <td><input name="button" type="button"  onclick="gourl();" value="Go Back"/></td>
  177.                     </tr>
  178.  
  179.       </table>
  180.  
  181.     </div>
  182.     <div id="contents">
  183.  
  184.     </div>
  185. <?php include("includes/footer.php");?>
  186.     <div style="clear:both;"></div>
  187. </div>
  188.  
  189. <map name="Map2" id="Map2"><area shape="rect" coords="3,2,133,25" href="gallery.php" />
  190. </map>
  191. </body>
  192. </html>
Feb 9 '09 #3

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

Similar topics

1
by: dan glenn | last post by:
I'm creating HTML emails from a PHP site and sending them out to an email list (just about 40 people so far are on this list). I've tested and confirmed that these emails work in yahoo.com's...
2
by: Brett | last post by:
I have a client that wants to send HTML based email. Building and sending isn't a problem, but he wants to include a plain text link at the top of the email that will display if the user doesn't...
5
by: BaWork | last post by:
I have a web form where a client can select which site members to send an email to. This form is populated from the contents of the member table, so the form can have 0-x names listed on it...
5
by: fochie | last post by:
Greetings, I'm trying to send data to my server using xmlhttp POST. The data being sent is actually an HTML page that is built with javascript in the browser. The HTML code contains a small...
2
by: Marcelo | last post by:
Hi guys, I'm using the following code to send values from one page to another, but seems to me, that the event Page_Load in the receiving page never fires. Why? This is the code: Thanks ...
6
by: Piedro | last post by:
Hi, has anyone in here got a good example or some hints on how to send a file directly from one pc to another pc using vb.net, for example I've got my pc's ip and a friends pc's ip and I want to...
3
by: Sydney | last post by:
Hi, I am trying to construct a WSE 2.0 security SOAP request in VBScript on an HTML page to send off to a webservice. I think I've almost got it but I'm having an issue generating the nonce...
4
by: Roger Withnell | last post by:
I'm sending Russian text in an email generated from the website which displays in the email as ?????????? The website is set to codepage 65001 and the charset to utf-8. Please advise. ...
1
by: robbiesmith79 | last post by:
Just so this is out there on the web, I battled the past 24 hours about this. Background info... I developed a ecommerce website in PHP 4 on a shared linux hosting plan from GoDaddy and had the...
10
by: Markgoldin | last post by:
I am sending an XML data from not dontnet process to a .Net via socket listener. Here is a data sample: <VFPData> <serverdata> <coderun>updateFloor</coderun> <area>MD2</area>...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.