dsafew1231 2018-06-11 16:52
浏览 252

如何在Laravel中通过电子邮件发送HTML格式

I am creating a website. In which there is a Registration page. After the user is registered an email is to be sent to his/her email address that user inputs during registration. I tried to send some text without any HTML tags and which was sent successfully. After which I created HTML format and tried again and at that time I got all the words, texts and HTML tags to the email address. Now I want to send the formatted text using the HTML format.

How can I do this ??

Mail HTML format. ( mail.blade.php )

<html>
<head>

</head>

<body>

<div class="row">
    <div class="col-md-6 col-md-offset-3">

        <div class="panel">
            <div class="panel-body">
                <div class="media-block">
                    <div class="media-left" style="white-space:nowrap">
                        <div class="invoice-logo col-md-12">
                            <div class="media-left">
                                <img src="https://1.bp.blogspot.com/-7NRmwzg6NFw/WqYbo3ydbRI/AAAAAAAAAxM/x_ei2ATh_1k7yJq9_TaXOTsdh1Mjm2rxQCLcBGAs/s400/PicsArt_03-12-11.46.14.jpg" style="width: 50%;"></br>
                                <small>Country</small></br>
                                <small>http://www.web.com/</small>
                            </div>
                        </div>
                    </div>
                    <div class="media-body text-right">
                        <h3 class="h1 text-uppercase text-normal mar-no">INVOICE</h3>
                    </div>
                </div>
                <hr class="new-section-sm bord-no">
                <div class="row">
                    <div class="col-xs-6">
                        <address>
                            <strong class="text-main">{{ $Mname }}</strong><br>
                            {{$date}}<br>
                            {{$st}}
                        </address>
                    </div>
                    <div class="col-xs-6">
                        <table class="pull-right invoice-details">
                            <tbody>
                            <tr>
                                <td class="text-main text-bold">Invoice #</td>
                                <td class="text-right text-primary text-bold">Id 1</td>
                            </tr>
                            <tr>
                                <td class="text-main text-bold">Billing Date</td>
                                <td class="text-right">From Date Db</td>
                            </tr>
                            <tr>
                                <td class="text-main text-bold">Amount Due</td>
                                <td class="text-right text-bold text-main">Total</td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                <hr class="new-section-sm bord-no">
                <div class="table-responsive">
                    <table class="table table-striped invoice-summary">
                        <thead>
                        <tr class="">
                            <th>Description</th>
                            <th class="min-col text-center">Qty</th>
                            <th class="min-col text-center">Price</th>
                            <th class="min-col text-right">Total</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td>
                                <strong>Des Db</strong>
                            </td>
                            <td class="text-center">Qty Db</td>
                            <td class="text-center">Price Db}</td>
                            <td class="text-right">Total Db</td>
                        </tr>
                        </tbody>
                    </table>
                    <table class="table invoice-total">
                        <tbody>
                        <tr>
                            <td><strong>TOTAL :</strong></td>
                            <td class="text-bold h4">Total Db</td>
                        </tr>
                        </tbody>
                    </table>
                </div>
</body>
</html> 
  • 写回答

3条回答 默认 最新

  • douchui1657 2018-06-11 18:33
    关注
    • Inline all the styling. Try not to use class names.
    • Use tables as much as possible. Don't use divs.
    • Try mjml.io if you're trying to make complex HTML template. It'll make your life really simple.
    评论

报告相同问题?

悬赏问题

  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line