2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

メールの送信元とは別のメアドを返信先に設定したい

Last updated at Posted at 2020-10-09

自分が知らなかっただけかもだけどメモ。

あるメールに対して返信するとき、デフォルトではFrom(送信元) のメアドが返信先に設定される。
これを変更したい場合は、ReplyTo(返信先) をヘッダに追加してあげると送信元とは別のメールを指定することができる。

以下はLaravelの例

Mail::send('emails.welcome', $data, function($message)
{
    $message->to('foo@example.com', 'John Smith')
        ->replyTo('reply@example.com', 'Reply Guy')
        ->subject('Welcome!');
});

参考:php - "Reply-to" field in Laravel mail is not working - Stack Overflow
参考:メール 7.x Laravel

そもそもメールヘッダにどんなものがあるか頭に入れておいた方が良さそう。後で読む。
メール系の知識 - Qiita

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?