{"id":3329,"date":"2014-06-04T20:50:44","date_gmt":"2014-06-04T11:50:44","guid":{"rendered":"http:\/\/peta.okechan.net\/blog\/?p=3329"},"modified":"2016-05-27T16:19:27","modified_gmt":"2016-05-27T07:19:27","slug":"laravel4-%e6%99%ae%e9%80%9a%e3%81%ae%e3%83%86%e3%82%ad%e3%82%b9%e3%83%88%e3%83%a1%e3%83%bc%e3%83%ab%e3%82%92%e9%80%81%e3%82%8a%e3%81%9f%e3%81%84","status":"publish","type":"post","link":"https:\/\/peta.okechan.net\/blog\/archives\/3329","title":{"rendered":"Laravel4: \u666e\u901a\u306e\u30c6\u30ad\u30b9\u30c8\u30e1\u30fc\u30eb\u3092\u9001\u308a\u305f\u3044"},"content":{"rendered":"<p>Laravel\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306f4.1.24\u3067\u3059\u3002<\/p>\n<p>\u3053\u3053\u3067\u8a00\u3046&#8221;\u666e\u901a\u306e\u30c6\u30ad\u30b9\u30c8\u30e1\u30fc\u30eb&#8221;\u3068\u3044\u3046\u306e\u306f<\/p>\n<ul>\n<li>\u4ef6\u540d\u3068\u672c\u6587\u304cISO-2022-JP\u306a\u65e5\u672c\u8a9e<\/li>\n<li>Content-Transfer-Encoding \u304c 7bit<\/li>\n<li>Content-Type \u304c text\/plain<\/li>\n<li>\u30de\u30eb\u30c1\u30d1\u30fc\u30c8\u3058\u3083\u306a\u3044<\/li>\n<\/ul>\n<p>\u3068\u3044\u3046\u4e8b\u3092\u8868\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u3093\u306a\u3054\u6642\u4e16\u306a\u306e\u3067\u6b63\u76f4\u5c0f\u7d30\u5de5\u306a\u3057\u3067UTF8\u3067\u9001\u308a\u305f\u3044\u3093\u3067\u3059\u3051\u3069\u306d\u3002<br \/>\n\uff08\u4eca\u56de\u306e\u8a71\u306f\u3042\u308b\u7d44\u7e54\u5185\u90e8\u3067\u4f7f\u3046\u3068\u3042\u308b\u7533\u8acb\u30d5\u30a9\u30fc\u30e0\u306b\u95a2\u9023\u3059\u308b\u3082\u306e\u306a\u306e\u3067\u3059\u304c\u3001\u307e\u3060\u30ac\u30e9\u30b1\u30fc\u4f7f\u3044\u3082\u591a\u3044\u7d44\u7e54\u3067\u3059\u306e\u3067\u3061\u3083\u3093\u3068\u5bfe\u5fdc\u3057\u3068\u3053\u3046\u3068\u601d\u3063\u305f\u6b21\u7b2c\u3067\u3059\uff09<\/p>\n<p>\u3067\u3001Laravel4\u3067ISO-2022-JP\u306a\u65e5\u672c\u8a9e\u30e1\u30fc\u30eb\u3092\u9001\u4fe1\u3059\u308b\u65b9\u6cd5\u3092\u8abf\u3079\u308b\u3068\u3001start\/global.php\u7b49\u306b<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n\\Swift::init(function()\r\n{\r\n    \\Swift_DependencyContainer::getInstance()\r\n        -&gt;register('mime.qpheaderencoder')\r\n        -&gt;asAliasOf('mime.base64headerencoder');\r\n\r\n    \\Swift_Preferences::getInstance()-&gt;setCharset('iso-2022-jp');\r\n});\r\n<\/pre>\n<p>\u3068\u8a18\u8ff0\u3057\u3066\u304a\u3044\u3066\u3001controller\u7b49\u3067<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\nMail::plain('emails.welcome', $data, function($message)\r\n{\r\n    $message-&gt;from('us@example.com', 'Laravel');\r\n        -&gt;to('foo@example.com')-&gt;cc('bar@example.com')\r\n        -&gt;subject('\u3042\u3044\u3046\u3048\u304a')\r\n        -&gt;setCharset('iso-2022-jp')\r\n        -&gt;setEncoder(new \\Swift_Mime_ContentEncoder_PlainContentEncoder('7bit'));\r\n});\r\n<\/pre>\n<p>\u306e\u3088\u3046\u306b\u3057\u3066\u9001\u4fe1\u3059\u308b\u3068\u826f\u3044\u3088\u3068\u3044\u3046\u60c5\u5831\u304c\u898b\u3064\u304b\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u3067\u307e\u3041\u3053\u3046\u3084\u308b\u3068\u78ba\u304b\u306bISO-2022-JP\u3067\u30e1\u30fc\u30eb\u304c\u9001\u4fe1\u51fa\u6765\u3066\u308b\u3088\u3046\u3067\u3057\u305f\u304c\u3001\u5c4a\u3044\u305f\u30e1\u30fc\u30eb\u306e\u30bd\u30fc\u30b9\u3092\u898b\u3066\u307f\u308b\u3068 Content-Type \u304c multipart\/alternative \u306b\u306a\u3063\u3066\u3044\u3066\u305d\u306e\u4e2d\u306e\u552f\u4e00\u306e\u30d1\u30fc\u30c8\u3068\u3057\u3066 Content-Type: text\/plain \u306a\u672c\u6587\u304c\u306f\u3044\u3063\u3066\u3044\u307e\u3057\u305f\u3002<br \/>\ntext\/plain \u306a\u30d1\u30fc\u30c8\u3072\u3068\u3064\u3057\u304b\u542b\u307e\u308c\u3066\u306a\u3044\u306e\u306b\u306a\u305c multipart\/alternative \u306a\u3063\u3066\u3057\u307e\u3046\u306e\u304b\u7406\u89e3\u306b\u82e6\u3057\u307f\u307e\u3057\u305f\u3002<br \/>\n\u3057\u304b\u3082 Content-Transfer-Encoding \u304c 7bit \u3067\u306f\u306a\u304f quoted-printable \u306b\u306a\u3063\u3066\u3057\u307e\u3063\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>\u6b63\u76f4\u3053\u306e\u72b6\u614b\u3067\u3082\u5b9f\u5bb3\u306f\u7121\u3044\u306e\u304b\u3082\u3057\u308c\u306a\u3044\u3093\u3067\u3059\u304c\u3001\u6c17\u6301\u3061\u60aa\u3044\u306e\u3067\u30e9\u30a4\u30d6\u30e9\u30ea\u5074\u306e\u30bd\u30fc\u30b9\u3092\u898b\u3066\u307f\u305f\u3089\u539f\u56e0\u304c\u3059\u3050\u306b\u5206\u304b\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>vendor\/laravel\/framework\/src\/Illuminate\/Mail\/Mailer.php \u306e Mailer \u30af\u30e9\u30b9\u306e addContent \u30e1\u30f3\u30d0\u95a2\u6570\u304c\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u5b9f\u88c5\u306b\u306a\u3063\u3066\u307e\u3057\u305f\u3002<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n\t\/**\r\n\t * Add the content to a given message.\r\n\t *\r\n\t * @param  \\Illuminate\\Mail\\Message  $message\r\n\t * @param  string  $view\r\n\t * @param  string  $plain\r\n\t * @param  array   $data\r\n\t * @return void\r\n\t *\/\r\n \tprotected function addContent($message, $view, $plain, $data)\r\n \t{\r\n\t\tif (isset($view))\r\n \t\t{\r\n\t\t\t$message-&gt;setBody($this-&gt;getView($view, $data), 'text\/html');\r\n \t\t}\r\n \r\n\t\tif (isset($plain))\r\n \t\t{\r\n\t\t\t$message-&gt;addPart($this-&gt;getView($plain, $data), 'text\/plain');\r\n \t\t}\r\n \t}\r\n<\/pre>\n<p>$view \u306b\u306f HTML\u30e1\u30fc\u30eb\u306e\u672c\u6587\u7528\u306e\u30d3\u30e5\u30fc\uff08\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\uff09\u540d\u304c\u5165\u3063\u3066\u3044\u3066\u3001 $plain \u306b\u306f\u30c6\u30ad\u30b9\u30c8\u30e1\u30fc\u30eb\u306e\u672c\u6587\u7528\u306e\u30d3\u30e5\u30fc\u540d\u304c\u5165\u3063\u3066\u304d\u307e\u3059\u3002<br \/>\n\u3042\u304d\u3089\u304b\u306b\u3001HTML\u30e1\u30fc\u30eb\u304c\u57fa\u672c\u306b\u306a\u3063\u3066\u3044\u3066\u3001\u30d7\u30ec\u30a4\u30f3\u30c6\u30ad\u30b9\u30c8\u306f\u305d\u308c\u306b\u4ed8\u968f\u3059\u308b\u60c5\u5831\u3068\u3044\u3046\u6271\u3044\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<br \/>\n\u306a\u306e\u3067 $view \u304c\u7a7a\u3067 $plain \u3060\u3051\u304c\u6307\u5b9a\u3055\u308c\u3066\u308b\u5834\u5408\u3001\u672c\u6587\u306f\u7121\u3044\u3051\u3069\u3082\u30d7\u30ec\u30a4\u30f3\u30c6\u30ad\u30b9\u30c8\u306e\u30d1\u30fc\u30c8\u304c\u542b\u307e\u308c\u305f\u30de\u30eb\u30c1\u30d1\u30fc\u30c8\u306a\u30e1\u30fc\u30eb\u304c\u51fa\u6765\u4e0a\u304c\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3092\u4fee\u6b63\u3059\u308b\u305f\u3081\u306b\u30e9\u30a4\u30d6\u30e9\u30ea\u5074\u306b\u624b\u3092\u3064\u3051\u306a\u3044\u65b9\u6cd5\u3092\u3042\u308c\u3053\u308c\u8003\u3048\u305f\u3093\u3067\u3059\u304c\u3001\u3042\u307e\u308a\u3044\u3044\u6848\u304c\u601d\u3044\u6d6e\u304b\u3070\u306a\u304b\u3063\u305f\u306e\u3067 addContent \u3092\u5909\u66f4\u3059\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n\t\/**\r\n\t * Add the content to a given message.\r\n\t *\r\n\t * @param  \\Illuminate\\Mail\\Message  $message\r\n\t * @param  string  $view\r\n\t * @param  string  $plain\r\n\t * @param  array   $data\r\n\t * @return void\r\n\t *\/\r\n\tprotected function addContent($message, $view, $plain, $data)\r\n\t{\r\n\t\tif (isset($plain))\r\n\t\t{\r\n\t\t\t$message-&gt;setBody($this-&gt;getView($plain, $data), 'text\/plain');\r\n\t\t}\r\n\r\n\t\tif (isset($view))\r\n\t\t{\r\n\t\t\t$message-&gt;addPart($this-&gt;getView($view, $data), 'text\/html');\r\n\t\t}\r\n\t}\r\n<\/pre>\n<p>\u5b89\u6613\u3067\u3059\u304c\u3001\u3053\u3093\u306a\u98a8\u306b\u66f8\u304d\u63db\u3048\u308b\u3053\u3068\u3067\u5f53\u521d\u306e\u76ee\u7684\u306f\u9054\u6210\u3067\u304d\u307e\u3057\u305f\u3002<br \/>\n\uff08$view \u304c\u7a7a\u3067\u306a\u3044\u5834\u5408\u306e\u30c6\u30b9\u30c8\u3092\u3057\u3066\u306a\u3044\u306e\u3067\u4f55\u304b\u554f\u984c\u3042\u308b\u304b\u3082\u3067\u3059\uff09<\/p>\n<p>\u305f\u3060\u3001\u3053\u308c\u3067\u9001\u3063\u3066\u307f\u308b\u3068\u672c\u6587\u304c\u5909\u306a\u3068\u3053\u308d\u3067\u6539\u884c\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3057\u307e\u3063\u305f\u306e\u3067\u3001\u81ea\u52d5\u3067\u6539\u884c\u3092\u542b\u3081\u3044\u306a\u3044\u3088\u3046\u306b\u3059\u308b\u305f\u3081\u3001\u9001\u4fe1\u6642\u306e\u30b3\u30fc\u30c9\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\nMail::plain('emails.welcome', $data, function($message)\r\n{\r\n    $message-&gt;from('us@example.com', 'Laravel');\r\n        -&gt;to('foo@example.com')-&gt;cc('bar@example.com')\r\n        -&gt;subject('\u3042\u3044\u3046\u3048\u304a')\r\n        -&gt;setCharset('iso-2022-jp')\r\n        -&gt;setEncoder(new \\Swift_Mime_ContentEncoder_PlainContentEncoder('7bit'))\r\n        -&gt;setMaxLineLength(0);\r\n});\r\n<\/pre>\n<p>setMaxLineLength(0)\u3067\u81ea\u52d5\u3067\u6539\u884c\u3092\u542b\u3081\u306a\u3044\u3088\u3046\u306b\u51fa\u6765\u308b\u3089\u3057\u3044\u3067\u3059\u3002<br \/>\nRFC\u3068\u304b\u3067\u884c\u306e\u6700\u5927\u9577\u3068\u304b\u304c\u6c7a\u307e\u3063\u3066\u308b\u3089\u3057\u3044\u306e\u3067\u3001\u307b\u3093\u3068\u3046\u306b\u5168\u304f\u6539\u884c\u305b\u305a\u306b\u9001\u4fe1\u3059\u308b\u306e\u306f\u30a2\u30ec\u3067\u3059\u304c\u3001\u57cb\u3081\u8fbc\u3080\u9805\u76ee\u306e\u6700\u5927\u9577\u306a\u3069\u3082\u8003\u616e\u3057\u3064\u3064\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u5074\u3067\u304d\u3061\u3093\u3068\u6210\u5f62\u3057\u3066\u3042\u308c\u3070\u554f\u984c\u306a\u3044\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u53c2\u8003<br \/>\n<a href=\"http:\/\/laravel.com\/docs\/mail\" target=\"_blank\">Laravel &#8211; The PHP Framework For Web Artisans.<\/a><br \/>\n<a href=\"http:\/\/kore1server.com\/125\" target=\"_blank\">Laravel4\u3001\u30e1\u30fc\u30eb\u306e\u9001\u4fe1<\/a><br \/>\n<a href=\"http:\/\/www.javable.jp\/blog\/1235.html\" target=\"_blank\">Swift Mailer \u306e\u30c6\u30ad\u30b9\u30c8\u30e1\u30fc\u30eb\u3067\u6539\u884c\u3055\u305b\u306a\u3044 | Javable.Jp<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Laravel\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306f4.1.24\u3067\u3059\u3002<\/p>\n<p>\u3053\u3053\u3067\u8a00\u3046&#8221;\u666e\u901a\u306e\u30c6\u30ad\u30b9\u30c8\u30e1\u30fc\u30eb&#8221;\u3068\u3044\u3046\u306e\u306f<\/p>\n<ul>\n<li>\u4ef6\u540d\u3068\u672c\u6587\u304cISO-2022-JP\u306a\u65e5\u672c\u8a9e<\/li>\n<li>Content-Transfer-Encoding \u304c 7bit<\/li>\n<li>Content-Type \u304c text\/plain<\/li>\n<li>\u30de\u30eb\u30c1\u30d1\u30fc\u30c8\u3058\u3083\u306a\u3044<\/li>\n<\/ul>\n<p>\u3068\u3044\u3046\u4e8b\u3092\u8868\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u3093\u306a\u3054\u6642\u4e16\u306a\u306e\u3067\u6b63\u76f4\u5c0f\u7d30\u5de5\u306a\u3057\u3067UTF8\u3067\u9001\u308a\u305f\u3044\u3093\u3067\u3059\u3051\u3069\u306d\u3002<br \/>\n\uff08\u4eca\u56de\u306e\u8a71\u306f\u3042\u308b\u7d44\u7e54\u5185\u90e8\u3067\u4f7f\u3046\u3068\u3042\u308b\u7533\u8acb\u30d5\u30a9\u30fc\u30e0\u306b\u95a2\u9023\u3059\u308b\u3082\u306e\u306a\u306e\u3067\u3059\u304c\u3001\u307e\u3060\u30ac\u30e9\u30b1\u30fc\u4f7f\u3044\u3082\u591a\u3044\u7d44\u7e54\u3067\u3059\u306e\u3067\u3061\u3083\u3093\u3068\u5bfe\u5fdc\u3057\u3068\u3053\u3046\u3068\u601d\u3063\u305f\u6b21\u7b2c\u3067\u3059\uff09<\/p>\n<p>\u3067\u3001Laravel4\u3067ISO-2022-JP\u306a\u65e5\u672c\u8a9e\u30e1\u30fc\u30eb\u3092\u9001\u4fe1\u3059\u308b\u65b9\u6cd5\u3092\u8abf\u3079\u308b\u3068\u3001start\/global.php\u7b49\u306b<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n\\Swift::init(function()\r\n{\r\n    \\Swift_DependencyContainer::getInstance()\r\n        -&gt;register('mime.qpheaderencoder')\r\n        -&gt;asAliasOf('mime.base64headerencoder');\r\n\r\n    \\Swift_Preferences::getInstance()-&gt;setCharset('iso-2022-jp');\r\n});\r\n<\/pre>\n<p>\u3068\u8a18\u8ff0\u3057\u3066\u304a\u3044\u3066\u3001controller\u7b49\u3067<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\nMail::plain('emails.welcome', $data, function($message)\r\n{\r\n    $message-&gt;from('us@example.com', 'Laravel');\r\n        -&gt;to('foo@example.com')-&gt;cc('bar@example.com')\r\n        -&gt;subject('\u3042\u3044\u3046\u3048\u304a')\r\n        -&gt;setCharset('iso-2022-jp')\r\n        -&gt;setEncoder(new \\Swift_Mime_ContentEncoder_PlainContentEncoder('7bit'));\r\n});\r\n<\/pre>\n<p>\u306e\u3088\u3046\u306b\u3057\u3066\u9001\u4fe1\u3059\u308b\u3068\u826f\u3044\u3088\u3068\u3044\u3046\u60c5\u5831\u304c\u898b\u3064\u304b\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u3067\u307e\u3041\u3053\u3046\u3084\u308b\u3068\u78ba\u304b\u306bISO-2022-JP\u3067\u30e1\u30fc\u30eb\u304c\u9001\u4fe1\u51fa\u6765\u3066\u308b\u3088\u3046\u3067\u3057\u305f\u304c\u3001\u5c4a\u3044\u305f\u30e1\u30fc\u30eb\u306e\u30bd\u30fc\u30b9\u3092\u898b\u3066\u307f\u308b\u3068 Content-Type \u304c multipart\/alternative \u306b\u306a\u3063\u3066\u3044\u3066\u305d\u306e\u4e2d\u306e\u552f\u4e00\u306e\u30d1\u30fc\u30c8\u3068\u3057\u3066 Content-Type: text\/plain \u306a\u672c\u6587\u304c\u306f\u3044\u3063\u3066\u3044\u307e\u3057\u305f\u3002<br \/>\ntext\/plain \u306a\u30d1\u30fc\u30c8\u3072\u3068\u3064\u3057\u304b\u542b\u307e\u308c\u3066\u306a\u3044\u306e\u306b\u306a\u305c multipart\/alternative \u306a\u3063\u3066\u3057\u307e\u3046\u306e\u304b\u7406\u89e3\u306b\u82e6\u3057\u307f\u307e\u3057\u305f\u3002<br \/>\n\u3057\u304b\u3082 Content-Transfer-Encoding \u304c 7bit \u3067\u306f\u306a\u304f quoted-printable \u306b\u306a\u3063\u3066\u3057\u307e\u3063\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>\u6b63\u76f4\u3053\u306e\u72b6\u614b\u3067\u3082\u5b9f\u5bb3\u306f\u7121\u3044\u306e\u304b\u3082\u3057\u308c\u306a\u3044\u3093\u3067\u3059\u304c\u3001\u6c17\u6301\u3061\u60aa\u3044\u306e\u3067\u30e9\u30a4\u30d6\u30e9\u30ea\u5074\u306e\u30bd\u30fc\u30b9\u3092\u898b\u3066\u307f\u305f\u3089\u539f\u56e0\u304c\u3059\u3050\u306b\u5206\u304b\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>vendor\/laravel\/framework\/src\/Illuminate\/Mail\/Mailer.php \u306e Mailer \u30af\u30e9\u30b9\u306e addContent \u30e1\u30f3\u30d0\u95a2\u6570\u304c\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u5b9f\u88c5\u306b\u306a\u3063\u3066\u307e\u3057\u305f\u3002<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n\t\/**\r\n\t * Add the content to a given message.\r\n\t *\r\n\t * @param  \\Illuminate\\Mail\\Message  $message\r\n\t * @param  string  $view\r\n\t * @param  string  $plain\r\n\t * @param  array   $data\r\n\t * @return void\r\n\t *\/\r\n \tprotected function addContent($message, $view, $plain, $data)\r\n \t{\r\n\t\tif (isset($view))\r\n \t\t{\r\n\t\t\t$message-&gt;setBody($this-&gt;getView($view, $data), 'text\/html');\r\n \t\t}\r\n \r\n\t\tif (isset($plain))\r\n \t\t{\r\n\t\t\t$message-&gt;addPart($this-&gt;getView($plain, $data), 'text\/plain');\r\n \t\t}\r\n \t}\r\n<\/pre>\n<p>$view \u306b\u306f HTML\u30e1\u30fc\u30eb\u306e\u672c\u6587\u7528\u306e\u30d3\u30e5\u30fc\uff08\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\uff09\u540d\u304c\u5165\u3063\u3066\u3044\u3066\u3001 $plain \u306b\u306f\u30c6\u30ad\u30b9\u30c8\u30e1\u30fc\u30eb\u306e\u672c\u6587\u7528\u306e\u30d3\u30e5\u30fc\u540d\u304c\u5165\u3063\u3066\u304d\u307e\u3059\u3002<br \/>\n\u3042\u304d\u3089\u304b\u306b\u3001HTML\u30e1\u30fc\u30eb\u304c\u57fa\u672c\u306b\u306a\u3063\u3066\u3044\u3066\u3001\u30d7\u30ec\u30a4\u30f3\u30c6\u30ad\u30b9\u30c8\u306f\u305d\u308c\u306b\u4ed8\u968f\u3059\u308b\u60c5\u5831\u3068\u3044\u3046\u6271\u3044\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<br \/>\n\u306a\u306e\u3067 $view \u304c\u7a7a\u3067 $plain \u3060\u3051\u304c\u6307\u5b9a\u3055\u308c\u3066\u308b\u5834\u5408\u3001\u672c\u6587\u306f\u7121\u3044\u3051\u3069\u3082\u30d7\u30ec\u30a4\u30f3\u30c6\u30ad\u30b9\u30c8\u306e\u30d1\u30fc\u30c8\u304c\u542b\u307e\u308c\u305f\u30de\u30eb\u30c1\u30d1\u30fc\u30c8\u306a\u30e1\u30fc\u30eb\u304c\u51fa\u6765\u4e0a\u304c\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3092\u4fee\u6b63\u3059\u308b\u305f\u3081\u306b\u30e9\u30a4\u30d6\u30e9\u30ea\u5074\u306b\u624b\u3092\u3064\u3051\u306a\u3044\u65b9\u6cd5\u3092\u3042\u308c\u3053\u308c\u8003\u3048\u305f\u3093\u3067\u3059\u304c\u3001\u3042\u307e\u308a\u3044\u3044\u6848\u304c\u601d\u3044\u6d6e\u304b\u3070\u306a\u304b\u3063\u305f\u306e\u3067 addContent \u3092\u5909\u66f4\u3059\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n\t\/**\r\n\t * Add the content to a given message.\r\n\t *\r\n\t * @param  \\Illuminate\\Mail\\Message  $message\r\n\t * @param  string  $view\r\n\t * @param  string  $plain\r\n\t * @param  array   $data\r\n\t * @return void\r\n\t *\/\r\n\tprotected function addContent($message, $view, $plain, $data)\r\n\t{\r\n\t\tif (isset($plain))\r\n\t\t{\r\n\t\t\t$message-&gt;setBody($this-&gt;getView($plain, $data), 'text\/plain');\r\n\t\t}\r\n\r\n\t\tif (isset($view))\r\n\t\t{\r\n\t\t\t$message-&gt;addPart($this-&gt;getView($view, $data), 'text\/html');\r\n\t\t}\r\n\t}\r\n<\/pre>\n<p>\u5b89\u6613\u3067\u3059\u304c\u3001\u3053\u3093\u306a\u98a8\u306b\u66f8\u304d\u63db\u3048\u308b\u3053\u3068\u3067\u5f53\u521d\u306e\u76ee\u7684\u306f\u9054\u6210\u3067\u304d\u307e\u3057\u305f\u3002<br \/>\n\uff08$view \u304c\u7a7a\u3067\u306a\u3044\u5834\u5408\u306e\u30c6\u30b9\u30c8\u3092\u3057\u3066\u306a\u3044\u306e\u3067\u4f55\u304b\u554f\u984c\u3042\u308b\u304b\u3082\u3067\u3059\uff09<\/p>\n<p>\u305f\u3060\u3001\u3053\u308c\u3067\u9001\u3063\u3066\u307f\u308b\u3068\u672c\u6587\u304c\u5909\u306a\u3068\u3053\u308d\u3067\u6539\u884c\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3057\u307e\u3063\u305f\u306e\u3067\u3001\u81ea\u52d5\u3067\u6539\u884c\u3092\u542b\u3081\u3044\u306a\u3044\u3088\u3046\u306b\u3059\u308b\u305f\u3081\u3001\u9001\u4fe1\u6642\u306e\u30b3\u30fc\u30c9\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\nMail::plain('emails.welcome', $data, function($message)\r\n{\r\n    $message-&gt;from('us@example.com', 'Laravel');\r\n        -&gt;to('foo@example.com')-&gt;cc('bar@example.com')\r\n        -&gt;subject('\u3042\u3044\u3046\u3048\u304a')\r\n        -&gt;setCharset('iso-2022-jp')\r\n        -&gt;setEncoder(new \\Swift_Mime_ContentEncoder_PlainContentEncoder('7bit'))\r\n        -&gt;setMaxLineLength(0);\r\n});\r\n<\/pre>\n<p>setMaxLineLength(0)\u3067\u81ea\u52d5\u3067\u6539\u884c\u3092\u542b\u3081\u306a\u3044\u3088\u3046\u306b\u51fa\u6765\u308b\u3089\u3057\u3044\u3067\u3059\u3002<br \/>\nRFC\u3068\u304b\u3067\u884c\u306e\u6700\u5927\u9577\u3068\u304b\u304c\u6c7a\u307e\u3063\u3066\u308b\u3089\u3057\u3044\u306e\u3067\u3001\u307b\u3093\u3068\u3046\u306b\u5168\u304f\u6539\u884c\u305b\u305a\u306b\u9001\u4fe1\u3059\u308b\u306e\u306f\u30a2\u30ec\u3067\u3059\u304c\u3001\u57cb\u3081\u8fbc\u3080\u9805\u76ee\u306e\u6700\u5927\u9577\u306a\u3069\u3082\u8003\u616e\u3057\u3064\u3064\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u5074\u3067\u304d\u3061\u3093\u3068\u6210\u5f62\u3057\u3066\u3042\u308c\u3070\u554f\u984c\u306a\u3044\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u53c2\u8003<br \/>\n<a href=\"http:\/\/laravel.com\/docs\/mail\" target=\"_blank\">Laravel &#8211; The PHP Framework For Web Artisans.<\/a><br \/>\n<a href=\"http:\/\/kore1server.com\/125\" target=\"_blank\">Laravel4\u3001\u30e1\u30fc\u30eb\u306e\u9001\u4fe1<\/a><br \/>\n<a href=\"http:\/\/www.javable.jp\/blog\/1235.html\" target=\"_blank\">Swift Mailer \u306e\u30c6\u30ad\u30b9\u30c8\u30e1\u30fc\u30eb\u3067\u6539\u884c\u3055\u305b\u306a\u3044 | Javable.Jp<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32],"tags":[477,74],"class_list":["post-3329","post","type-post","status-publish","format-standard","hentry","category-tech","tag-laravel4","tag-php"],"_links":{"self":[{"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/posts\/3329","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/comments?post=3329"}],"version-history":[{"count":0,"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/posts\/3329\/revisions"}],"wp:attachment":[{"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/media?parent=3329"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/categories?post=3329"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/tags?post=3329"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}