မင်္ဂလာပါ!

လှိုက်လှဲစွာကြိုဆိုပါသည်။ ယခု ပထမဆုံးအကြိမ် ရောက်ဖူးခြင်းဖြစ်ပါသလား? ဝင်ရောက် ဆွေးနွေး မေးမြန်းလိုပါလျှင် အောက်တွင်ဖော်ပြထားသော button များမှတဆင့် ဝင်ရောက် ဆွေးနွေးနိုင်သကဲ့သို့ အဖွဲ့ဝင်အသစ်အနေဖြင့်လည်း လျှောက်ထားနိုင်ပါတယ်။

MYSTERY ZILLION တွင် English သို့မဟုတ် Unicode ဖြင့်သာ အသုံးပြုခွင့်ရှိသည်။ ဇော်ဂျီ ၊ ဧရာ စသည်တို့ကို အသုံးပြုခွင့် မရှိ။ Unicode fonts များမှာ Mon3,Yunghkio, Myanamr3 စသည်များ အသုံးပြုနိုင်သည်။ Unicode Guide ကို ဒီမှာ Download ချပါ။ Zawgyi to Unicode Converter
Don't share ebook or software if nobody request. You can find free book websites on here. We are welcome for discussion or asking question instead.

Problem in sending HTML with php!

edited July 2009 in PHP
Problem in sending HTML Mail with php!

I am writing the website, there I want to send all the information and selecting data to email with HTML format. I can do but I have a problem that is when I choose all the data in my form ( I means maximum data collecting from the form), the problem is all the data cannot shown in email but can display after submit page. After the submit I display all in the information into table ( like a airline booking confirmation, the booking confirmation was sent to email ). In the email the data is left not shown 100%, it is only 80%. The rest 20% is not shown. I have reference code below that I copy from their post.

<?PHP
$title=$_POST;
$name=$_POST;
$email=$_POST;
$telephone=$_POST;
$fax=$_POST;
$address=$_POST;
$country=$_POST;
$comment=$_POST;

# -=-=-=- MIME BOUNDARY
$mime_boundary = "----MSA Shipping----".md5(time());
# -=-=-=- MAIL HEADERS
$to = "[email protected]";
//$to = "[email protected]";
//$to = "[email protected]";
$subject = "Information Request from MSA Shipping - Contact Form";
$headers = "From: MSA SHIPPING <[email protected]>\n";
$headers .= "Reply-To: MSA Shipping <[email protected]>\n";
$headers .= "BCC: [email protected]";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-Type: multipart/alternative; boundary=\"$mime_boundary\"\n";

$message .= "--$mime_boundary\n";
$message .= "Content-Type: text/html; charset=UTF-8\n";
$message .= "Content-Transfer-Encoding: 8bit\n\n";

$message .= "<html>\n";
$message .= "<body style=\"font-family:Verdana, Verdana, Geneva, sans-serif; font-size:12px; color:#666666;\">\n";

$message .= "<table width=\"800\" height=\"159\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" >";
$message .="<tr>";
$message .="<td height=\"66\" colspan=\"4\" bgcolor=\"#CCCCCC\"></td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td width=\"1%\"></td>";
$message .="<td colspan=\"3\"> </td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td> </td>";
$message .="<td width=\"100\"><b>Title</b></td>";
$message .="<td align=\"left\" >:</td>";
$message .="<td>$title</td>";
$message .="<tr>";
$message .="<td> </td>";
$message .="<td><b>Name</b></td>";
$message .="<td>:</td>";
$message .="<td>$name</td>";
$message .="</tr>";
$message .="</tr>";
$message .="<tr>";
$message .="<td> </td>";
$message .="<td><b>E-mail</b></td>";
$message .="<td>:</td>";
$message .="<td>$email</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td> </td>";
$message .="<td><b>Telephone</b></td>";
$message .="<td>:</td>";
$message .="<td>$telephone</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td> </td>";
$message .="<td><b>Fax</b></td>";
$message .="<td>:</td>";
$message .="<td>$fax</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td> </td>";
$message .="<td><b>Country</b></td>";
$message .="<td>:</td>";
$message .="<td>$country</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td> </td>";
$message .="<td><b>Comments</b></td>";
$message .="<td>:</td>";
$message .="<td>$comment</td>";
$message .="</tr>";
$message .="<tr>";
$message .="<td height=\"21\" colspan=\"4\" bgcolor=\"#CCCCCC\"></td>";
$message .="</tr>";
$message .="</table>";
$message .= "</body>\n";
$message .= "</html>\n";

# -=-=-=- FINAL BOUNDARY
$message .= "--$mime_boundary--\n\n";
# -=-=-=- SEND MAIL
$mail_sent = @mail( $to, $subject, $message, $headers );
//echo $mail_sent ? "Mail sent" : "Mail failed";
if($mail_sent)
{
header('Location:contactus.php?msg=yes');
}
else
{
header('Location:contactus.php?msg=no');
}
?>

I have a php result in the html body. How am I solve the problem for showing all the data in one mail.

Please headache for me :77: :77: :77:

မှတ်ချက်များ

  • edited July 2009 Registered Users
    Here it is. Tested.

    4u9ul2.png
    <?PHP
    $title=$_POST['title'];
    $name=$_POST['name'];
    $email=$_POST['email'];
    $telephone=$_POST['telephone'];
    $fax=$_POST['fax'];
    $address=$_POST['address'];
    $country=$_POST['country'];
    $comment=$_POST['comment'];
    
    # -=-=-=- MIME BOUNDARY
    //$mime_boundary = "----MSA Shipping----".md5(time());
    # -=-=-=- MAIL HEADERS
    $to = "[email protected]";
    //$to = "[email protected]";
    //$to = "[email protected]";
    $subject = "Information Request from MSA Shipping - Contact Form";
    $headers = "MIME-Version: 1.0\n";
    $headers .= "Content-Type: text/html; charset=UTF-8\n";
    $headers .= "Content-Transfer-Encoding: 8bit\n";
    $headers .= "From: MSA SHIPPING <[email protected]>\n";
    $headers .= "Reply-To: MSA Shipping <[email protected]>\n\n";
    $headers .= "BCC: [email protected]";
    //$headers .= "Content-Type: multipart/alternative; boundary=\"$mime_boundary\"\n";
    
    //$message .= "--$mime_boundary\n";
    
    $message = "<html>\n";
    $message .= "<body style=\"font-family:Verdana, Verdana, Geneva, sans-serif; font-size:12px; color:#666666;\">\n";
    
    $message .= "<table width=\"800\" height=\"159\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" >";
    $message .="<tr>";
    $message .="<td height=\"66\" colspan=\"4\" bgcolor=\"#CCCCCC\"></td>";
    $message .="</tr>";
    $message .="<tr>";
    $message .="<td width=\"1%\"></td>";
    $message .="<td colspan=\"3\">&nbsp;</td>";
    $message .="</tr>";
    $message .="<tr>";
    $message .="<td>&nbsp;</td>";
    $message .="<td width=\"100\"><b>Title</b></td>";
    $message .="<td align=\"left\" >:</td>";
    $message .="<td>$title</td>";
    $message .="<tr>";
    $message .="<td>&nbsp;</td>";
    $message .="<td><b>Name</b></td>";
    $message .="<td>:</td>";
    $message .="<td>$name</td>";
    $message .="</tr>";
    $message .="</tr>";
    $message .="<tr>";
    $message .="<td>&nbsp;</td>";
    $message .="<td><b>E-mail</b></td>";
    $message .="<td>:</td>";
    $message .="<td>$email</td>";
    $message .="</tr>";
    $message .="<tr>";
    $message .="<td>&nbsp;</td>";
    $message .="<td><b>Telephone</b></td>";
    $message .="<td>:</td>";
    $message .="<td>$telephone</td>";
    $message .="</tr>";
    $message .="<tr>";
    $message .="<td>&nbsp;</td>";
    $message .="<td><b>Fax</b></td>";
    $message .="<td>:</td>";
    $message .="<td>$fax</td>";
    $message .="</tr>";
    $message .="<tr>";
    $message .="<td>&nbsp;</td>";
    $message .="<td><b>Country</b></td>";
    $message .="<td>:</td>";
    $message .="<td>$country</td>";
    $message .="</tr>";
    $message .="<tr>";
    $message .="<td>&nbsp;</td>";
    $message .="<td><b>Comments</b></td>";
    $message .="<td>:</td>";
    $message .="<td>$comment</td>";
    $message .="</tr>";
    $message .="<tr>";
    $message .="<td height=\"21\" colspan=\"4\" bgcolor=\"#CCCCCC\"></td>";
    $message .="</tr>";
    $message .="</table>";
    $message .= "</body>\n";
    $message .= "</html>\n";
    # -=-=-=- FINAL BOUNDARY
    //$message .= "--$mime_boundary--\n\n";
    # -=-=-=- SEND MAIL
    $mail_sent = @mail( $to, $subject, $message, $headers );
    //echo $mail_sent ? "Mail sent" : "Mail failed";
    if($mail_sent)
    {
    header('Location:contactus.php?msg=yes');
    }
    else
    {
    header('Location:contactus.php?msg=no');
    }
    ?>
    
    Hope it works for you. :)
Sign In or Register to comment.