{"id":1235,"date":"2013-10-05T23:32:14","date_gmt":"2013-10-05T14:32:14","guid":{"rendered":"http:\/\/www.javable.jp\/blog\/?p=1235"},"modified":"2016-05-30T06:51:42","modified_gmt":"2016-05-29T21:51:42","slug":"swift-mailer-%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%81%a7%e6%94%b9%e8%a1%8c%e3%81%95%e3%81%9b%e3%81%aa%e3%81%84","status":"publish","type":"post","link":"https:\/\/www.javable.jp\/blog\/1235.html","title":{"rendered":"Swift Mailer \u306e\u30c6\u30ad\u30b9\u30c8\u30e1\u30fc\u30eb\u3067\u6539\u884c\u3055\u305b\u306a\u3044"},"content":{"rendered":"<p>\r\n  Laravel3 \u3067\u306e\u30e1\u30fc\u30eb\u9001\u4fe1\u306b Swift Mailer \u3092\u4f7f\u3063\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001\u6a19\u984c\u306e\u3068\u304a\u308a\u3001text\/plain \u306a\u30e1\u30fc\u30eb\u9001\u4fe1\u3092\u884c\u306a\u3046\u6642\u306b\u3001\u672c\u6587\u304c\u9014\u4e2d\u3067\u6539\u884c\u3055\u308c\u3066\u3057\u307e\u3046\u73fe\u8c61\u306b\u51fa\u304f\u308f\u3057\u307e\u3057\u305f\u3002\r\n<\/p>\r\n<p>\r\n  \u3050\u3050\u3063\u3066\u3082\uff08\u898b\u843d\u3068\u3057\u305f\u3060\u3051\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\uff09\u65e5\u672c\u8a9e\u3067\u306f\u4f3c\u305f\u3088\u3046\u306a\u73fe\u8c61\u3078\u306e\u89e3\u6c7a\u7b56\u306f\u30d2\u30c3\u30c8\u3057\u307e\u305b\u3093\u3067\u3057\u305f\u3057\u3001\u82f1\u8a9e\u306eQA\u30b5\u30a4\u30c8\u306a\u3093\u304b\u3067\u3082\u300ctext\/html\u3067\u9001\u308b\u3068\u826f\u3044\u3088\u3002\u672c\u6587\u306f nl2br() \u304b\u3051\u3066\u3001\u6539\u884c\u30b3\u30fc\u30c9\u3092 &lt;br \/&gt;\u306b\u5909\u63db\u3057\u3066\u306d\u300d\u306a\u3093\u3066\u3001\u305d\u308c\u306f\u3061\u3087\u3063\u3068\u9055\u3046\u3060\u308d\u3046\u3068\u3044\u3046\u3088\u3046\u306a\u56de\u7b54\u3070\u304b\u308a\u3060\u3063\u305f\u306e\u3067\u3001Swift Mailer \u306e\u30bd\u30fc\u30b9\u3092\u8aad\u3093\u3067\u307f\u305f\u3089\u3001\u3061\u3083\u3093\u3068\u30e1\u30bd\u30c3\u30c9\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3057\u305f\u3002\r\n<\/p>\r\n<pre class=\"code_list\">\r\n<span class=\"comment\">\/\/ \u30e1\u30c3\u30bb\u30fc\u30b8\u4f5c\u6210<\/span>\r\n$message = \\Swift_Message::newInstance();\r\n$message\r\n    ->setCharset($encode)\r\n    ->setEncoder(\\Swift_Encoding::get7BitEncoding())\r\n    ->setSubject($subject)\r\n    ->setFrom($from)\r\n    ->setTo($to)\r\n    ->setReturnPath($return_path)\r\n    ->setBody($body, 'text\/plain')\r\n    -><a style=\"font-weight:700;\" href=\"http:\/\/swiftmailer.org\/docs\/messages.html#setting-the-line-length\" target=\"_blank\">setMaxLineLength(<span style=\"color:red\">0<\/span>)<\/a>; <span class=\"comment\" style=\"font-weight:700;\">\/\/ &lt;--\u3053\u308c<\/span>\r\n<\/pre>\r\n<p>\r\n  \u4e00\u5fdc\u3061\u3083\u3093\u3068<a href=\"http:\/\/swiftmailer.org\/docs\/messages.html#setting-the-line-length\" target=\"_blank\" class=\"external\">\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8<\/a>\u306b\u3082\u66f8\u3044\u3066\u3042\u308a\u307e\u3059\u306d\u3002\r\n<\/p>\r\n<p>\r\n  \u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306b\u306f\u300c\u5f15\u6570\u306b1000\u3088\u308a\u5927\u304d\u3044\u6570\u3092\u4e0e\u3048\u308b\u3068\u3001RFC2822\u306b\u6cbf\u308f\u306a\u304f\u306a\u308b\u306e\u3067\u3001\u30b5\u30fc\u30d0\u30fc\u5074\u3067\u9577\u3044\u884c\u3092\u30ab\u30c3\u30c8\u3059\u308b\u4e8b\u3082\u3042\u308b\u3088\u300d\u306e\u3088\u3046\u306a\u4e8b\u304c\u66f8\u3044\u3066\u3042\u308a\u307e\u3059\u304c\u3001\u305f\u3044\u3066\u3044\u672c\u6587\u306e\u6539\u884c\u4f4d\u7f6e\u306f\u30e1\u30fc\u30eb\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3067\u304d\u3061\u3093\u3068\u6307\u5b9a\u3057\u3066\u6574\u5f62\u3057\u3066\u3044\u305f\u308a\u3059\u308b\u306e\u3067\u3001\u3053\u3053\u306f\u5f15\u6570\u306b\u300c<span style=\"color:red\">0<\/span>\u300d\u3092\u4e0e\u3048\u3066\u300c<span style=\"color:red\">\u7121\u5236\u9650\uff08\uff1d\u6539\u884c\u7121\u3057\uff09<\/span>\u300d\u3068\u3044\u3046\u4e8b\u306b\u3057\u307e\u3057\u305f\u3002\r\n<\/p>","protected":false},"excerpt":{"rendered":"Laravel3 \u3067\u306e\u30e1\u30fc\u30eb\u9001\u4fe1\u306b Swift Mailer \u3092\u4f7f\u3063\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001\u6a19\u984c\u306e\u3068\u304a\u308a\u3001text\/plain \u306a\u30e1\u30fc\u30eb\u9001\u4fe1\u3092\u884c\u306a\u3046\u6642\u306b\u3001\u672c\u6587\u304c\u9014\u4e2d\u3067\u6539\u884c\u3055\u308c\u3066\u3057\u307e\u3046\u73fe\u8c61\u306b\u51fa\u304f\u308f\u3057\u307e\u3057\u305f\u3002 \u3050\u3050\u3063\u3066\u3082\uff08\u898b\u843d\u3068\u3057\u305f [&hellip;]","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-1235","post","type-post","status-publish","format-standard","hentry","category-programming"],"_links":{"self":[{"href":"https:\/\/www.javable.jp\/blog\/wp-json\/wp\/v2\/posts\/1235","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javable.jp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javable.jp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javable.jp\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javable.jp\/blog\/wp-json\/wp\/v2\/comments?post=1235"}],"version-history":[{"count":11,"href":"https:\/\/www.javable.jp\/blog\/wp-json\/wp\/v2\/posts\/1235\/revisions"}],"predecessor-version":[{"id":1741,"href":"https:\/\/www.javable.jp\/blog\/wp-json\/wp\/v2\/posts\/1235\/revisions\/1741"}],"wp:attachment":[{"href":"https:\/\/www.javable.jp\/blog\/wp-json\/wp\/v2\/media?parent=1235"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javable.jp\/blog\/wp-json\/wp\/v2\/categories?post=1235"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javable.jp\/blog\/wp-json\/wp\/v2\/tags?post=1235"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}