{"id":2759,"date":"2022-03-09T13:20:20","date_gmt":"2022-03-09T04:20:20","guid":{"rendered":"https:\/\/j-online.ne.jp\/blog\/?p=2759"},"modified":"2022-03-09T13:43:08","modified_gmt":"2022-03-09T04:43:08","slug":"%e6%b7%bb%e4%bb%98%e3%83%95%e3%82%a1%e3%82%a4%e3%83%ab%e4%bb%98%e3%83%a1%e3%83%bc%e3%83%ab%e3%82%92%e5%8f%97%e4%bf%a1%e3%81%97%e3%81%9f%e3%81%a8%e5%90%8c%e6%99%82%e3%81%ab%e3%80%81%e4%bb%96%e3%82%b5","status":"publish","type":"post","link":"https:\/\/j-online.ne.jp\/blog\/%e3%82%b7%e3%82%b9%e3%83%86%e3%83%a0%e9%96%8b%e7%99%ba\/%e6%b7%bb%e4%bb%98%e3%83%95%e3%82%a1%e3%82%a4%e3%83%ab%e4%bb%98%e3%83%a1%e3%83%bc%e3%83%ab%e3%82%92%e5%8f%97%e4%bf%a1%e3%81%97%e3%81%9f%e3%81%a8%e5%90%8c%e6%99%82%e3%81%ab%e3%80%81%e4%bb%96%e3%82%b5","title":{"rendered":"\u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u4ed8\u30e1\u30fc\u30eb\u3092\u53d7\u4fe1\u3057\u305f\u3068\u540c\u6642\u306b\u3001\u4ed6\u30b5\u30fc\u30d0\u306b\u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u3092\u30b3\u30d4\u30fc\u3055\u305b\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u4f5c\u3063\u3066\u307f\u305f"},"content":{"rendered":"<p>\u3069\u3046\u3082\u8d85\u9762\u5012\u304f\u3055\u304c\u308a\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u300c\u3055\u3055\u3084\u30fc\u307e\u300d\u3067\u3059\u3002<br \/>\n\u9762\u5012\u304f\u3055\u304c\u308a\u3060\u304b\u3089\u30a8\u30f3\u30b8\u30cb\u30a2\u306b\u306a\u3063\u305f\u3068\u3044\u3063\u3066\u3082\u904e\u8a00\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002<br \/>\n\u5358\u7d14\u4f5c\u696d\u306f\u3001\u6642\u9593\u306e\u3042\u308b\u3068\u304d\u306b\u81ea\u52d5\u5316\u3057\u3066\u3084\u308d\u3046\u3068\u3044\u3064\u3082\u8003\u3048\u3066\u304a\u308a\u307e\u3059\u3002<br \/>\n\u3067\u3001\u4eca\u56de\u306f\u30d6\u30ed\u30b0\u306e\u30cd\u30bf\u3064\u3044\u3067\u306b\u3001\u696d\u52d9\u3067\u624b\u52d5\u4f5c\u696d\u3057\u3066\u3044\u308b\u3082\u306e\u3092\u81ea\u52d5\u5316\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<h1>\u4f5c\u696d\u306e\u6d41\u308c<\/h1>\n<h2>\u81ea\u52d5\u5316\u524d\u306e\u6d41\u308c<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/j-online.ne.jp\/blog\/wp-content\/uploads\/2022\/03\/92b1adfd5069172c0ce5a9e8ba74f493.png\" alt=\"\u81ea\u52d5\u5316\u524d\" width=\"500\" height=\"375\" class=\"alignnone size-full wp-image-2780\" srcset=\"https:\/\/j-online.ne.jp\/blog\/wp-content\/uploads\/2022\/03\/92b1adfd5069172c0ce5a9e8ba74f493.png 720w, https:\/\/j-online.ne.jp\/blog\/wp-content\/uploads\/2022\/03\/92b1adfd5069172c0ce5a9e8ba74f493-300x225.png 300w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/p>\n<ol>\n<li>\u9867\u5ba2\u304b\u3089\u30e1\u30fc\u30eb\uff08\u6dfb\u4ed8\u753b\u50cf\u4ed8\uff09\u304cXserver\u4e0a\u306e\u300c\u3055\u3055\u3084\u30fc\u307e\u300d\u5b9b\u30e1\u30fc\u30eb\u30dc\u30c3\u30af\u30b9\u306b\u5c4a\u304f\u3002<\/li>\n<li>\u300c\u3055\u3055\u3084\u30fc\u307e\u300d\u304c\u30e1\u30fc\u30eb\u3092\u53d7\u4fe1\u3057\u3066\u3001\u6dfb\u4ed8\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3092scp\u30b3\u30de\u30f3\u30c9\u3092\u7528\u3044\u3066A\u30b5\u30fc\u30d0\u3078\u30b3\u30d4\u30fc\u3002<\/li>\n<li>A\u30b5\u30fc\u30d0\u3078\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3092\u30b3\u30d4\u30fc\u5b8c\u4e86\u3057\u305f\u65e8\u3092\u9867\u5ba2\u3078\u30e1\u30fc\u30eb\u3067\u8fd4\u4fe1\u3002<\/li>\n<\/ol>\n<h2>\u81ea\u52d5\u5316\u5f8c\u306e\u6d41\u308c<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/j-online.ne.jp\/blog\/wp-content\/uploads\/2022\/03\/1a3f4016a4c2968ebcae38cff93ce495.png\" alt=\"\u81ea\u52d5\u5316\u5f8c\" width=\"500\" height=\"375\" class=\"alignnone size-full wp-image-2781\" srcset=\"https:\/\/j-online.ne.jp\/blog\/wp-content\/uploads\/2022\/03\/1a3f4016a4c2968ebcae38cff93ce495.png 720w, https:\/\/j-online.ne.jp\/blog\/wp-content\/uploads\/2022\/03\/1a3f4016a4c2968ebcae38cff93ce495-300x225.png 300w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/p>\n<ol>\n<li>\u9867\u5ba2\u304b\u3089\u30e1\u30fc\u30eb\uff08\u6dfb\u4ed8\u753b\u50cf\u4ed8\uff09\u304cXserver\u4e0a\u306e\u300c\u3055\u3055\u3084\u30fc\u307e\u300d\u5b9b\u30e1\u30fc\u30eb\u30dc\u30c3\u30af\u30b9\u306b\u5c4a\u304f\u3002<\/li>\n<li>Xserver\u4e0a\u306e\u300c\u3055\u3055\u3084\u30fc\u307e\u300d\u5b9b\u30e1\u30fc\u30eb\u30dc\u30c3\u30af\u30b9\u306b\u5c4a\u3044\u305f\u30e1\u30fc\u30eb\u3092\u540c\u30b5\u30fc\u30d0\u4e0a\u3067php\u30d7\u30ed\u30b0\u30e9\u30e0\u306b\u8ee2\u9001\u3002\u30e1\u30fc\u30eb\u89e3\u6790\u3092\u884c\u3044php\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u6dfb\u4ed8\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3092A\u30b5\u30fc\u30d0\u3078\u30b3\u30d4\u30fc\u3002<\/li>\n<li>A\u30b5\u30fc\u30d0\u3078\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3092\u30b3\u30d4\u30fc\u5b8c\u4e86\u3057\u305f\u65e8\u3092php\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u9867\u5ba2\u3078\u30e1\u30fc\u30eb\u3067\u81ea\u52d5\u8fd4\u4fe1\u3002<\/li>\n<\/ol>\n<h1>\u81ea\u52d5\u5316\u3059\u308b\u305f\u3081\u306e\u6e96\u5099<\/h1>\n<h2>\u6761\u4ef6<\/h2>\n<ul>\n<li>Xserver\u3067\u30e1\u30fc\u30eb\u30b5\u30fc\u30d3\u30b9\u3092\u5229\u7528\u3057\u3066\u30e1\u30fc\u30eb\u306e\u9001\u53d7\u4fe1\u3092\u3057\u3066\u3044\u308b<\/li>\n<li>\u4e0a\u8a18Xserver\u4e0a\u3067Laravel\u3092\u52d5\u304b\u3059\u3053\u3068\u304c\u3067\u304d\u308b\uff08Laravel\u306eartisan\u30b3\u30de\u30f3\u30c9\u3092\u4f5c\u6210\uff09<\/li>\n<li>Xserver\u304b\u3089A\u30b5\u30fc\u30d0\u3078SSH\u63a5\u7d9a\u304c\u3067\u304d\u308b<\/li>\n<\/ul>\n<h2>\u5fc5\u8981\u30e9\u30a4\u30d6\u30e9\u30ea\u7b49\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n<p><em><span style=\"color: #ff0000;\">\u203b\u4f7f\u7528\u3057\u3066\u3044\u308b\u30b5\u30fc\u30d0\u306e\u90fd\u5408\u4e0a\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u306ephp\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u5909\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u306a\u304b\u3063\u305f\u305f\u3081\u3001php\u306f\u30d5\u30eb\u30d1\u30b9\u6307\u5b9a\u3067\u5b9f\u884c\u3057\u3066\u3044\u307e\u3059\u3002<\/span><\/em><\/p>\n<p>Xserver\u3078\u81ea\u52d5\u5316\u306b\u5fc5\u8981\u306a\u30e9\u30a4\u30d6\u30e9\u30ea\u7b49\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<br \/>\nSSH\u30ed\u30b0\u30a4\u30f3\u6642\u306e\u30db\u30fc\u30e0\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306f\u4ee5\u4e0b\u3068\u3057\u3066\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n<pre><code>\/home\/sasayama<\/code><\/pre>\n<h3>composer\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n<pre><code>\r\n$ cd\r\n$ mkdir bin\r\n$ cd bin\r\n$ curl -sS https:\/\/getcomposer.org\/installer | php\r\n$ mv composer.phar composer\r\n<\/code><\/pre>\n<h3>mailparse\u30e9\u30a4\u30d6\u30e9\u30ea\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n<p>\u5f8c\u8ff0\u306ephp-mime-mail-parser\u3067\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre><code>\r\n$ cd\r\n$ mkdir php_source\r\n$ cd php_source\/\r\n$ wget https:\/\/pecl.php.net\/get\/mailparse-3.1.3.tgz\r\n$ tar zxvf mailparse-3.1.3.tgz\r\n$ cd mailparse-3.1.3\r\n$ \/opt\/php-7.4.25\/bin\/phpize\r\n$ .\/configure  --with-php-config=\/opt\/php-7.4.25\/bin\/php-config\r\n$ make\r\n<\/code><\/pre>\n<h3>Laravel\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u4f5c\u6210<\/h3>\n<p>\u81ea\u52d5\u5316\u3092\u884c\u3046\u51e6\u7406\u3092Laravel\u306e\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u4f5c\u6210\u3059\u308b\u305f\u3081\u3001Laravel\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre><code>\r\n$ cd\r\n$ \/usr\/bin\/php7.4 \/home\/sasayama\/bin\/composer create-project laravel\/laravel:^8.0 byebye-sasayama\r\n<\/code><\/pre>\n<h3>league\/flysystem-sftp\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n<p>sftp\u3067\u4ed6\u30b5\u30fc\u30d0\u3078\u30d5\u30a1\u30a4\u30eb\u30b3\u30d4\u30fc\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre><code>\r\n$ cd byebye-sasayama\r\n$ \/usr\/bin\/php7.4 \/home\/sasayama\/bin\/composer require league\/flysystem-sftp \"~1.0\"\r\n<\/code><\/pre>\n<h3>php-mime-mail-parser\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n<p>\u53d7\u4fe1\u3057\u305f\u30e1\u30fc\u30eb\u3092\u89e3\u6790\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre><code>\r\n$ \/usr\/bin\/php7.4 \/home\/sasayama\/bin\/composer require php-mime-mail-parser\/php-mime-mail-parser\r\n<\/code><\/pre>\n<h2>Laravel\u8a2d\u5b9a<\/h2>\n<p>Laravel\u306e\u30d5\u30a1\u30a4\u30eb\u30b9\u30c8\u30ec\u30fc\u30b8\u3067sftp\u3092\u4f7f\u7528\u3059\u308b\u305f\u3081\u306b\u8a2d\u5b9a\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<p><strong>config\/filesystems.php<\/strong><\/p>\n<pre><code>\r\n'sftp' =&gt; [\r\n    'driver' =&gt; 'sftp',\r\n    'host' =&gt; 'xxx.xxx.xxx.xxxx',   \/\/ \u2190 A\u30b5\u30fc\u30d0\u306eIP\u30a2\u30c9\u30ec\u30b9\r\n    'port' =&gt; 22,\r\n    'username' =&gt; 'xxxxxxx',    \/\/ \u2190 A\u30b5\u30fc\u30d0\u3078\u306eSSH\u63a5\u7d9a\u30a2\u30ab\u30a6\u30f3\u30c8\r\n    'password' =&gt; 'xxxxxxx',    \/\/ \u2190 A\u30b5\u30fc\u30d0\u3078\u306eSSH\u63a5\u7d9a\u30d1\u30b9\u30d5\u30ec\u30fc\u30ba\r\n    'root' =&gt; '\/home\/xxxx\/image',  \/\/ \u2190 A\u30b5\u30fc\u30d0\u3078\u306eSSH\u63a5\u7d9a\u5f8c\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u30d1\u30b9\r\n    'privateKey' =&gt; '\/xxxxx\/id_rsa.pem',  \/\/ \u2190 A\u30b5\u30fc\u30d0\u3078\u306eSSH\u63a5\u7d9a\u79d8\u5bc6\u9375 PEM\u5f62\u5f0f\r\n    'timeout' =&gt; 30,\r\n]\r\n<\/code><\/pre>\n<p><em>\u203b\u79d8\u5bc6\u9375\u306fPEM\u5f62\u5f0f\u3067\u3059\u3002<\/em><br \/>\n\u3059\u3067\u306bopenssh\u5f62\u5f0f\u3067\u4f5c\u6210\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u5909\u63db\u3067\u304d\u307e\u3059\u3002<br \/>\nopenssh\u5f62\u5f0f\u3092\u4e0a\u66f8\u304d\u3057\u3066\u3057\u307e\u3046\u306e\u3067\u3001\u6b8b\u3057\u305f\u3044\u5834\u5408\u306f\u30b3\u30d4\u30fc\u3057\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u30d1\u30b9\u30d5\u30ec\u30fc\u30ba\u306fopenssh\u5f62\u5f0f\u3068\u540c\u3058\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><code>\r\n$ cp ~\/.ssh\/id_rsa ~\/.ssh\/id_rsa.pem\r\n$ ssh-keygen -p -m pem -f ~\/.ssh\/id_rsa.pem\r\n<\/code><\/pre>\n<h2>\u81ea\u52d5\u5316\u30d7\u30ed\u30b0\u30e9\u30e0\u4f5c\u6210<\/h2>\n<p>Laravel\u30b3\u30de\u30f3\u30c9\u751f\u6210\u3057\u3066\u3001\u51e6\u7406\u3092\u66f8\u3044\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<pre><code>\r\n$ \/usr\/bin\/php7.4 artisan command:scp-attached-file\r\n<\/code><\/pre>\n<p>\u5b8c\u4e86\u30e1\u30fc\u30eb\u7528\u306eMailable\u30af\u30e9\u30b9\u3092\u4ee5\u4e0b\u30b3\u30de\u30f3\u30c9\u3067\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre><code>\r\n$ \/usr\/bin\/php7.4 artisan make:mail SendResultEmail\r\n<\/code><\/pre>\n<h4>app\/Console\/Commands\/ScpAttachedFile.php<\/h4>\n<p>\u6700\u5c0f\u9650\u306e\u51e6\u7406\u3060\u3051\u66f8\u304d\u307e\u3059\u3002<br \/>\n<em>*\u30bd\u30fc\u30b9\u4e2d\u306b\u3082\u304b\u304d\u307e\u3057\u305f\u304c\u3001\u3053\u306e\u307e\u307e\u3067\u306f\u7121\u6761\u4ef6\u306bsftp\u8ee2\u9001\u304c\u5b9f\u884c\u3055\u308c\u307e\u3059\u306e\u3067\u6761\u4ef6\u3092\u5165\u308c\u3066\u5fc5\u8981\u306a\u3068\u304d\u3060\u3051\u51e6\u7406\u304c\u5b9f\u884c\u3055\u308c\u308b\u3088\u3046\u306b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/em><\/p>\n<pre><code>\r\n&lt;?php\r\n\r\nnamespace App\\Console\\Commands;\r\n\r\nuse Illuminate\\Console\\Command;\r\nuse Illuminate\\Support\\Facades\\Storage;\r\nuse Illuminate\\Support\\Facades\\Mail;\r\nuse eXorus\\PhpMimeMailParser\\Parser;\r\nuse eXorus\\PhpMimeMailParser\\Attachment;\r\nuse App\\Mail\\SendResultEmail;\r\n\r\nclass ScpAttachedFile extends Command\r\n{\r\n    \/**\r\n     * The name and signature of the console command.\r\n     *\r\n     * @var string\r\n     *\/\r\n    protected $signature = 'command:scp-attached-file';\r\n\r\n    \/**\r\n     * The console command description.\r\n     *\r\n     * @var string\r\n     *\/\r\n    protected $description = '\u53d7\u4fe1\u30e1\u30fc\u30eb\u3057\u305f\u30e1\u30fc\u30eb\u306e\u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb\u3092\u6307\u5b9a\u30b5\u30fc\u30d0\u306bSCP\u3067\u30b3\u30d4\u30fc\u3057\u307e\u3059';\r\n\r\n    \/**\r\n     * Create a new command instance.\r\n     *\r\n     * @return void\r\n     *\/\r\n    public function __construct()\r\n    {\r\n        parent::__construct();\r\n    }\r\n\r\n    \/**\r\n     * Execute the console command.\r\n     *\r\n     * @return int\r\n     *\/\r\n    public function handle()\r\n    {\r\n        $parser = new Parser();\r\n        $parser-&gt;setStream(fopen('php:\/\/stdin', 'r'));\r\n\r\n        \/\/ to\u53d6\u5f97\r\n        $rawHeaderto = $parser-&gt;getHeader('to');\r\n\r\n        \/\/ from\u53d6\u5f97\r\n        $rawHeaderFrom = $parser-&gt;getHeader('from');\r\n\r\n        \/\/ \u4ef6\u540d\r\n        $subject = $parser-&gt;getHeader('subject');\r\n\r\n        \/\/ \u30e1\u30fc\u30eb\u672c\u6587\u53d6\u5f97\r\n        $text = $parser-&gt;getMessageBody('text');\r\n        $html = $parser-&gt;getMessageBody('html');\r\n        $htmlEmbedded = $parser-&gt;getMessageBody('htmlEmbedded');\r\n\t\t\r\n        \/\/ \u3053\u3053\u306b\u3044\u308d\u3044\u308d\u6761\u4ef6\u3044\u308c\u3066\u304f\u3060\u3055\u3044\r\n        \/\/ \u6761\u4ef6\u3044\u308c\u306a\u3044\u3068\u3059\u3079\u3066\u306e\u30e1\u30fc\u30eb\u306b\u5bfe\u3057\u3066\u51e6\u7406\u304c\u8d70\u308a\u307e\u3059\r\n        \/\/ \u4f8b\u3048\u3070\u3001to\u304cA\u3055\u3093\u304b\u3089\u3060\u3063\u305f\u3089\u3068\u304b\u3001subject\u304c\u300c\u753b\u50cf\u8ffd\u52a0\u4f9d\u983c\u300d\u3060\u3063\u305f\u3089\u51e6\u7406\u3059\u308b\u3068\u304b\u30fb\u30fb\u30fb\u3002\r\n\r\n        \/\/ \u6dfb\u4ed8\u753b\u50cf\u8ee2\u9001\u51e6\u7406\r\n        try {\r\n            $attachments = $parser-&gt;getAttachments();\r\n            foreach ($attachments as $attachment) {\r\n                \/\/ type\u304cjpg\u3060\u3063\u305f\u3089\u51e6\u7406\r\n                if ($attachment-&gt;getContentType() === 'image\/jpeg') {\r\n                    \/\/ \u2193\u3000\u305f\u3063\u305f\u3053\u308c\u3060\u3051\u3067sfp\u8ee2\u9001\u3067\u304d\u308b\r\n                    Storage::disk('sftp')-&gt;put($attachment-&gt;getFilename(), $attachment-&gt;getContent());\r\n\r\n                    if (Storage::disk('sftp')-&gt;exists($attachment-&gt;getFilename())) {\r\n                        \/\/ \u8ee2\u9001\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u306e\u5b58\u5728\u30c1\u30a7\u30c3\u30afOK\r\n                    } else {\r\n                        \/\/ \u8ee2\u9001\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u306e\u5b58\u5728\u30c1\u30a7\u30c3\u30afNO\r\n                        throw \\Exception(\"\u66f8\u304d\u8fbc\u307f\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f);\r\n                    }\r\n                }\r\n            }\r\n        } catch (\\Exception $e) {\r\n            logs()-&gt;error($e-&gt;getMessage());\r\n            return 0;\r\n        }\r\n\r\n        \/\/ \u8ee2\u9001\u5b8c\u4e86\u30e1\u30fc\u30eb\u9001\u4fe1\r\n        Mail::to('hoge@fuga.com')-&gt;send(new SendResultEmail());\r\n\r\n        return 0;\r\n    }\r\n}\r\n<\/code><\/pre>\n<h4>app\/Mail\/SendResultEmail.php<\/h4>\n<p>\u3053\u3061\u3089\u3082\u672c\u8a18\u4e8b\u3067\u306f\u5fc5\u8981\u6700\u5c0f\u9650\u306e\u51e6\u7406\u3067\u3059\u3002\u30e1\u30fc\u30eb\u306b\u4f55\u304b\u3057\u3089\u51e6\u7406\u306e\u5185\u5bb9\u3092\u6e21\u3057\u305f\u3044\u5834\u5408\u306f\u3053\u3061\u3089\u3067\u51e6\u7406\u3057\u307e\u3059\u3002<\/p>\n<pre><code>\r\n&lt;?php\r\n\r\nnamespace App\\Mail;\r\n\r\nuse Illuminate\\Bus\\Queueable;\r\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\r\nuse Illuminate\\Mail\\Mailable;\r\nuse Illuminate\\Queue\\SerializesModels;\r\n\r\nclass SendResultEmail extends Mailable\r\n{\r\n    use Queueable, SerializesModels;\r\n\r\n    \/**\r\n     * Create a new message instance.\r\n     *\r\n     * @return void\r\n     *\/\r\n    public function __construct()\r\n    {\r\n    }\r\n\r\n    \/**\r\n     * Build the message.\r\n     *\r\n     * @return $this\r\n     *\/\r\n    public function build()\r\n    {\r\n        return $this-&gt;subject('\u8ee2\u9001\u51e6\u7406\u5b8c\u4e86\u3057\u307e\u3057\u305f')\r\n                    -&gt;text('emails.send_result_email');\r\n    }\r\n}\r\n<\/code><\/pre>\n<h4>resources\/views\/emails\/send_result_email.blade.php<\/h4>\n<p>\u9001\u4fe1\u3059\u308b\u30e1\u30fc\u30eb\u672c\u6587\u3067\u3059\u3002<\/p>\n<pre><code>\r\n\u3044\u3064\u3082\u304a\u4e16\u8a71\u306b\u306a\u3063\u3066\u304a\u308a\u307e\u3059\u3002\r\n\u30b8\u30a7\u30a4\u30aa\u30f3\u30e9\u30a4\u30f3\u306e\u7b39\u5c71\u3067\u3059\u3002\r\n\r\n\u8ee2\u9001\u51e6\u7406\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002\r\n\r\n\u3054\u78ba\u8a8d\u3088\u308d\u3057\u304f\u304a\u9858\u3044\u305f\u3057\u307e\u3059\u3002\r\n\r\n-------------------------------------------\r\n\u682a\u5f0f\u4f1a\u793e\u30b8\u30a7\u30a4\u30aa\u30f3\u30e9\u30a4\u30f3\r\n\u7b39\u5c71\u3000\u662d\u79c0\r\n<\/code><\/pre>\n<h1>Xserver\u8a2d\u5b9a<\/h1>\n<p>\u524d\u8ff0\u3067\u6e96\u5099\u306f\u5b8c\u4e86\u3057\u305f\u306e\u3067\u3001\u4f5c\u6210\u3057\u305f\u30d7\u30ed\u30b0\u30e9\u30e0\u3092Xserver\u306e\u30e1\u30fc\u30eb\u30dc\u30c3\u30af\u30b9\u306b\u53d7\u4fe1\u3057\u305f\u3068\u540c\u6642\u306b\u5b9f\u884c\u3055\u305b\u307e\u3059\u3002<\/p>\n<h2>mailfilter\u306e\u8a2d\u5b9a<\/h2>\n<p>\u5c4a\u3044\u305f\u30e1\u30fc\u30eb\u3092\u632f\u308a\u5206\u3051\u308b\u3082\u306e\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u3053\u306e\u632f\u308a\u5206\u3051\u6a5f\u80fd\u3092\u7528\u3044\u3066\u3001\u53d7\u4fe1\u3057\u305f\u30e1\u30fc\u30eb\u3092\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u6a19\u6e96\u5165\u529b\u306b\u6e21\u3057\u307e\u3059\u3002<\/p>\n<p>Xserver\u306e\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u7de8\u96c6\u3057\u307e\u3059\u3002<\/p>\n<pre><code>\/home\/[\u30b5\u30fc\u30d0\u30fcID]\/[\u30c9\u30e1\u30a4\u30f3\u540d]\/mail\/[\u30b5\u30d6\u30c9\u30e1\u30a4\u30f3]\/[\u30a2\u30c9\u30ec\u30b9\u540d]\/.alias\r\n<\/code><\/pre>\n<pre><code>cc \"!hoge@jonline.com\"\r\ncc \"| \/usr\/bin\/php7.4 -d extension=\/home\/sasayama\/php_source\/mailparse-3.1.3\/modules\/mailparse.so \/home\/sasayama\/mohtool\/artisan command:scp-attached-file\"\r\n<\/code><\/pre>\n<p><em>\u203bmailparse.so\u3067\u3059\u304c\u30b5\u30fc\u30d0\u306e\u90fd\u5408\u4e0aphp.ini\u306b\u8a2d\u5b9a\u3059\u308b\u306e\u306f\u3084\u3081\u3066\u3001\u81ea\u52d5\u5316\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u52d5\u304f\u3068\u304d\u3060\u3051\u6307\u5b9a\u3057\u3066\u5b9f\u884c\u3057\u3066\u3044\u307e\u3059\u3002<\/em><\/p>\n<p>\u3053\u308c\u3067Xserver\u4e0a\u306e\u30e1\u30fc\u30eb\u30dc\u30c3\u30af\u30b9\u306b\u30e1\u30fc\u30eb\u304c\u5c4a\u3044\u305f\u3068\u540c\u6642\u306b\u81ea\u52d5\u5316\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002<\/p>\n<h1>\u307e\u3068\u3081<\/h1>\n<p>\u306a\u304c\u306a\u304c\u3068\u306a\u308a\u307e\u3057\u305f\u304c\u3001\u3053\u308c\u3067\u81ea\u52d5\u5316\u3067\u304d\u307e\u3057\u305f\u3002<br \/>\n\u30d0\u30a4\u30d0\uff5e\u30a4\u300c\u3055\u3055\u3084\u30fc\u307e\u300d\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3069\u3046\u3082\u8d85\u9762\u5012\u304f\u3055\u304c\u308a\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u300c\u3055\u3055\u3084\u30fc\u307e\u300d\u3067\u3059\u3002 \u9762\u5012\u304f\u3055\u304c\u308a\u3060\u304b\u3089\u30a8\u30f3\u30b8\u30cb\u30a2\u306b\u306a\u3063\u305f\u3068\u3044\u3063\u3066\u3082\u904e\u8a00\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002 \u5358\u7d14\u4f5c\u696d\u306f\u3001\u6642\u9593\u306e\u3042\u308b\u3068\u304d\u306b\u81ea\u52d5\u5316\u3057\u3066\u3084\u308d\u3046\u3068\u3044\u3064\u3082\u8003\u3048\u3066\u304a\u308a\u307e\u3059\u3002 \u3067\u3001\u4eca\u56de\u306f\u30d6\u30ed\u30b0 [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":2864,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"sns_share_botton_hide":"","vkExUnit_sns_title":"","sitemap_hide":"","_veu_custom_css":"","veu_display_promotion_alert":"","vkexunit_cta_each_option":"","_jetpack_memberships_contains_paid_content":false,"_lightning_design_setting":{"layout":"default"},"footnotes":""},"categories":[109,108,81],"tags":[],"class_list":["post-2759","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-laravel","category-php","category-81"],"aioseo_notices":[],"veu_head_title_object":{"title":"","add_site_title":""},"jetpack_featured_media_url":"https:\/\/j-online.ne.jp\/blog\/wp-content\/uploads\/2022\/03\/byebye_boy.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/j-online.ne.jp\/blog\/wp-json\/wp\/v2\/posts\/2759","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/j-online.ne.jp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/j-online.ne.jp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/j-online.ne.jp\/blog\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/j-online.ne.jp\/blog\/wp-json\/wp\/v2\/comments?post=2759"}],"version-history":[{"count":54,"href":"https:\/\/j-online.ne.jp\/blog\/wp-json\/wp\/v2\/posts\/2759\/revisions"}],"predecessor-version":[{"id":4834,"href":"https:\/\/j-online.ne.jp\/blog\/wp-json\/wp\/v2\/posts\/2759\/revisions\/4834"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/j-online.ne.jp\/blog\/wp-json\/wp\/v2\/media\/2864"}],"wp:attachment":[{"href":"https:\/\/j-online.ne.jp\/blog\/wp-json\/wp\/v2\/media?parent=2759"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/j-online.ne.jp\/blog\/wp-json\/wp\/v2\/categories?post=2759"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/j-online.ne.jp\/blog\/wp-json\/wp\/v2\/tags?post=2759"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}