【问题标题】:How to send links in mail Laravel如何在邮件 Laravel 中发送链接
【发布时间】:2020-05-19 06:36:55
【问题描述】:

我用 Laravel 发送邮件:

邮件\用户.php

return $this->from('admin@example.com', 'Admin')
        ->subject('Register in example')
        ->markdown('mails.user')
        ->with([
            'name' => 'Register in example',
            'link' => $link,
        ]);

邮件\user.blade.php

@component('mail::message')

Link:
<a href="{{$link}}">{{$link}}</a>
@endcomponent

邮件到达收件箱:

Link:
<a href="http://...">http://...</a>

仅在 gmail 上,当我输入常规链接时,它可以工作,即

邮件\user.blade.php

@component('mail::message')

Link:
{{$link}}
@endcomponent

在第一行 Laravel 创建 tag. I don't know why, I write text in the same tag @component('mail::message'):

@component('mail::message')
**Hi**,



Twój indywidualny link do sprawdzania udziałów:
    [{{$linkActivation}}]({{$linkActivation}})

@endcomponent

“嗨”有效,但链接无效。 在收件箱中,例如:

其余文字

【问题讨论】:

  • 你有什么问题?
  • 如何发送clicable链接?
  • 什么不工作?
  • 邮件到达收件箱, 标记为文本
  • 我的回答有用吗?

标签: laravel email


【解决方案1】:

您在 Mail\User.php 中使用的是 markdown 而不是 HTML:-&gt;markdown('mails.user')

您需要使用markdown syntax发送链接,[link text](URL)

【讨论】:

    【解决方案2】:
    猜你喜欢
    • 1970-01-01
    • 2014-02-08
    • 1970-01-01
    • 2019-09-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-06-19
    相关资源
    最近更新 更多