Giter Club home page Giter Club logo

laravel-mail-aliyun's Introduction

Laravel mail aliyun

📧 Aliyun DrirectMail Transport for Laravel Application.

Sponsor me

Installing

$ composer require overtrue/laravel-mail-aliyun -vvv

Configuration

API documention: https://help.aliyun.com/document_detail/29435.html

config/services.php

    'directmail' => [
        'key' => env('ALIYUN_ACCESS_KEY_ID'),
        'secret' => env('ALIYUN_ACCESS_KEY_SECRET'),
        'region_id' => env('ALIYUN_REGION_ID'),
        'from_address' => env('ALIYUN_FROM_ADDRESS'),
        'from_alias' => env('ALIYUN_FROM_ALIAS'),
    ],

AccessKeyID 和 AccessKeySecret 由阿里云官方颁发给用户的 AccessKey 信息(可以通过阿里云控制台用户信息管理中查看和管理).

Usage

Set default mail driver and configuration:

.env

MAIL_DRIVER=directmail

ALIYUN_ACCESS_KEY_ID=  #AccessKeyID
ALIYUN_ACCESS_KEY_SECRET= #AccessKeySecret
ALIYUN_REGION_ID= #RegionID: cn-hangzhou, ap-southeast-1, ap-southeast-2
ALIYUN_FROM_ADDRESS= #FromAddress
ALIYUN_FROM_ALIAS= #FromAlias

TagName

use Overtrue\LaravelMailAliyun\HasTagName;
class VerifyMail extend Mailable{
    use HasTagName;
    public function build()
    {
        $this->tagName('alreadyDefinedTag');
        return $this->text('mails.verify');
    }
}

Please reference the official doc: Laravel Sending mail

❤️ Sponsor me

Sponsor me

如果你喜欢我的项目并想支持它,点击这里 ❤️

Project supported by JetBrains

Many thanks to Jetbrains for kindly providing a license for me to work on this and other open-source projects.

PHP 扩展包开发

想知道如何从零开始构建 PHP 扩展包?

请关注我的实战课程,我会在此课程中分享一些扩展开发经验 —— 《PHP 扩展包实战教程 - 从入门到发布》

License

MIT

laravel-mail-aliyun's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

laravel-mail-aliyun's Issues

有计划切换至 symfony/mailer 么?

安装的时候有 Warning

Package swiftmailer/swiftmailer is abandoned, you should avoid using it. Use symfony/mailer instead

所以想问一下有没有计划切换至 symfony/mailer. 谢谢!

AccessKeySecret

阿里云签名机制需要用到AccessKeySecret ,config里只有AccessKeyId,代码里签名时用的也是AccessKeyId,是否有问题?

InvalidArgumentException:Driver [directmail] not supported

我的 .env 文件里:MAIL_DRIVER=directmailconfig/services.php 添加了如下:

'directmail' => [
        'key' => env('ALIYUN_ACCESS_KEY_ID'),
        'address_type' => 1,
        'from_alias' => 'fucker',
        'click_trace' => 0,
        'version' => '2015-11-23',
        'region_id' => 'cn-hangzhou',
    ],

结果就报错了。

Laravel 版本:5.7

我在 config/mail.php 里看到:

/*
    |--------------------------------------------------------------------------
    | Mail Driver
    |--------------------------------------------------------------------------
    |
    | Laravel supports both SMTP and PHP's "mail" function as drivers for the
    | sending of e-mail. You may specify which one you're using throughout
    | your application here. By default, Laravel is setup for SMTP mail.
    |
    | Supported: "smtp", "sendmail", "mailgun", "mandrill", "ses",
    |            "sparkpost", "log", "array"
    |
    */

    'driver' => env('MAIL_DRIVER', 'smtp'),

该如何解决呢?

下的laravel最新版7.21.0

下的laravel最新版7.21.0报
[2020-07-25 08:44:50] local.ERROR: Expected response code 250 but got code "550", with message "550 5.7.1 Relaying denied
" {"exception":"[object] (Swift_TransportException(code: 550): Expected response code 250 but got code "550", with message "550 5.7.1 Relaying denied
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.