doudang8824 2017-04-19 01:32
浏览 26
已采纳

如何以简单的联系表格显示粗体文本?

I would like to know how to bold face certain text in a contact form. I am sort of new at this. I would like categorize the output of the form. For example:

Contact Information: (in bold) Name:
Email: . . . Event / Trip Details: (in bold) Num of passengers: . . .

So far I have only "Contact information:" and "Event / Trip Details" below. I am not sure what to do to bold face them.

    $formcontent="Contact Information:  
 
Name: $name 
 
Email: $email 
    
 
Phone: $phone 
 
Company / Group Name: $cmpny 
 
Street Name: 
    $street 
 
City, State, Zip Code: $city_st_zip 
 
Respond Via:  
    $respond 
 
Event / Trip Details: 
 
Number of Passengers:  
    $num_passengers 
 
Trip Type:  $trip_type 
 
Number of Pickups:  
    $num_pickups 
 
Bus Size:  $bus_size 
 
Name:  $pickup_name 
 
    
Street Name:  $pickup_street_name 
 
City, State, Zip Code:  
    $pickup_city_st_zip 
 
Depart Date:  $depart_date 
 
Depart Time:  
    $depart_time 
 
Name:  $dropoff_name 
 
Street Name:  
    $dropoff_street_name 
 
City, State, Zip Code:  $dropoff_city_st_zip 
    
 
Return Date:  $dropoff_date 
 
Return Time:  $dropoff_time 
 
    
Itinerary / Special Instructions / Additional Info:  $spec_instr 
 
    
Airport Meet & Greet:  $meet_greet 
 
ADA Accessible Coach:  $ada 
 
    
Extra Storage:  $extra 
 
How did you find us?  $find_us";
    $recipient = "jldouglas58@gmail.com";
    $subject = "Request for a Quote";
    $mailheader = "From: $email 
";
    mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
    header( 'Location: http://www.distancebrothers.com/quote-
    confirmation.html') ;?>
  • 写回答

3条回答 默认 最新

  • dtnd30892 2017-04-19 01:39
    关注

    First of all the email header shoud state that the mail is in HTML format.

    $headers .= "Content-Type: text/html; charset=ISO-8859-1
    ";
    

    Then you format your message in HTML eg:

    $formcontent="<html> <body>Contact Information:  
     
    Name: <strong>$name </strong>
     
    Email: $email 
        
     
    Phone: $phone 
     
    Company / Group Name: $cmpny 
     
    Street Name: 
        $street 
     
    City, State, Zip Code: $city_st_zip 
     
    Respond Via:  
        $respond 
     
    Event / Trip Details: 
     
    Number of Passengers:  
        $num_passengers 
     
    Trip Type:  $trip_type 
     
    Number of Pickups:  
        $num_pickups 
     
    Bus Size:  $bus_size 
     
    Name:  $pickup_name 
     
        
    Street Name:  $pickup_street_name 
     
    City, State, Zip Code:  
        $pickup_city_st_zip 
     
    Depart Date:  $depart_date 
     
    Depart Time:  
        $depart_time 
     
    Name:  $dropoff_name 
     
    Street Name:  
        $dropoff_street_name 
     
    City, State, Zip Code:  $dropoff_city_st_zip 
        
     
    Return Date:  $dropoff_date 
     
    Return Time:  $dropoff_time 
     
        
    Itinerary / Special Instructions / Additional Info:  $spec_instr 
     
        
    Airport Meet & Greet:  $meet_greet 
     
    ADA Accessible Coach:  $ada 
     
        
    Extra Storage:  $extra 
     
    How did you find us?  $find_us </body> </html>";
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?