{"id":777,"date":"2023-11-09T10:27:17","date_gmt":"2023-11-09T01:27:17","guid":{"rendered":"https:\/\/sumomo.ohwaki.jp\/wordpress\/?p=777"},"modified":"2023-11-09T10:40:38","modified_gmt":"2023-11-09T01:40:38","slug":"mailkit-smtp%e9%80%81%e4%bf%a1%e3%82%a8%e3%83%a9%e3%83%bc","status":"publish","type":"post","link":"https:\/\/sumomo.ohwaki.jp\/wordpress\/?p=777","title":{"rendered":"MailKit SMTP\u9001\u4fe1\u30a8\u30e9\u30fc"},"content":{"rendered":"\n<p>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304b\u3089\u30e1\u30fc\u30eb\u3092\u9001\u4fe1\u3059\u308b\u305f\u3081\u306b\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u611f\u3058\u3067MailKit.Net.Smtp\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-csharp\" data-file=\"SMTP(\u65e7)\" data-lang=\"C#\"><code>SmtpClient cli = new SmtpClient();\nawait cli.ConnectAsync(&quot;smtp.boo.foo&quot;,25);\nawait cli.SendAsync(msg);<\/code><\/pre><\/div>\n\n\n\n<p>Connect\u30e1\u30bd\u30c3\u30c9\u3067\u3001\u30b5\u30fc\u30d0\u30fc\u3068\u30dd\u30fc\u30c8\u306e\u307f\u6307\u5b9a\u3059\u308b\u5f62\u3002\u4eca\u307e\u3067\u306f\u666e\u901a\u306b\u52d5\u3044\u3066\u3044\u305f\u306e\u3060\u304c\u3001SMTP\u30b5\u30fc\u30d0\u30fc\u3092IIS\u306eSMTP\u304b\u3089Linux sendmail\u306b\u5909\u66f4\u3057\u305f\u3068\u3053\u308d\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u4f8b\u5916\u304c\u767a\u751f\u3057\u305f\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-bash\" data-file=\"\u4f8b\u5916\" data-lang=\"Bash\"><code>An error occurred while attempting to establish an SSL or TLS connection.\nThe host name (xxx.xxx.xxx) did not match the name given in the server&#39;s SSL certificate (yyy.yyy.yyy).<\/code><\/pre><\/div>\n\n\n\n<p>\u3069\u3046\u3082\u3001START TLS\u306e\u95a2\u4fc2\u3089\u3057\u3044\u3002\u8272\u3005\u8abf\u3079\u3066\u307f\u305f\u304c\u3001\u53d6\u6562\u3048\u305a\u3001\u4ee5\u4e0b\u306e\u65b9\u6cd5\u3067\u89e3\u6c7a\u306f\u3057\u305f\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-csharp\" data-file=\"SMTP(\u65b0)\" data-lang=\"C#\"><code>await cli.ConnectAsync(&quot;smtp.boo.foo&quot;,25,SecureSocketOptions.None);<\/code><\/pre><\/div>\n\n\n\n<p>\u3057\u304b\u3057\u3001\u6700\u521d\u306e\u69d8\u306a\u30b3\u30fc\u30c9\u3092\u6301\u3064\u30a2\u30d7\u30ea\u304c\u7d50\u69cb\u3042\u308b\u305f\u3081\u3001SMTP\u30b5\u30fc\u30d0\u30fc\u5074\u3067\u3069\u3046\u306b\u304b\u306a\u3089\u306a\u3044\u304b\u8abf\u3079\u3066\u307f\u305f\u3068\u3053\u308d\u3001sendmail\u306e\u5834\u5408\u3060\u3068\u3001access\u306b\u4e0b\u8a18\u306e\u8a2d\u5b9a\u3092\u884c\u306a\u3048\u3070\u3001\u300cSMTP\u30b5\u30fc\u30d0\u30fc\u306fSTART TLS\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u306a\u3044\u300d\u3068\u3044\u3046\u5ba3\u8a00?\u306b\u306a\u308b\u3089\u3057\u3044\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-bash\" data-file=\"\/etc\/mail\/access\" data-lang=\"Bash\"><code># Check the \/usr\/share\/doc\/sendmail\/README.cf file for a description\n# of the format of this file. (search for access_db in that file)\n# The \/usr\/share\/doc\/sendmail\/README.cf is part of the sendmail-doc\n# package.\n#\n# If you want to use AuthInfo with &quot;M:PLAIN LOGIN&quot;, make sure to have the\n# cyrus-sasl-plain package installed.\n#\n# By default we allow relaying from localhost...\nSrv_Features:   S\n\u30fb\u30fb\u30fb<\/code><\/pre><\/div>\n\n\n\n<p>\u3053\u306e\u8a2d\u5b9a\u3092\u884c\u306a\u3044\u3001sendmail\u3092\u518d\u8d77\u52d5\u3057\u305f\u5f8c\u306b\u3001\u5143\u306e\u30b3\u30fc\u30c9\u3067\u30e1\u30fc\u30eb\u9001\u4fe1\u3092\u884c\u306a\u3063\u305f\u3068\u3053\u308d\u3001\u6b63\u5e38\u306b\u30e1\u30fc\u30eb\u304c\u9001\u4fe1\u3055\u308c\u305f\u3002<\/p>\n\n\n\n<p>\u793e\u5185\u3067\u3057\u304b\u4f7f\u7528\u3057\u306a\u3044SMTP\u30ea\u30ec\u30fc\u30b5\u30fc\u30d0\u30fc\u306a\u306e\u3067\u3001TLS\u306f\u5fc5\u8981\u306a\u3044\u305f\u3081\u3001\u3053\u308c\u3067\u826f\u3057\u3068\u3057\u3088\u3046\u3002<\/p>\n\n\n\n<p>\u3067\u3082\u3001\u3053\u306e\u65b9\u6cd5\u898b\u3064\u3051\u305f\u306e\u306f\u3001\u7d50\u69cb\u306a\u6570\u306e\u30a2\u30d7\u30ea\u30b3\u30fc\u30c9\u76f4\u3057\u305f\u5f8c\u3060\u3063\u305f\u308a\u3059\u308b\u3002Orz<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304b\u3089\u30e1\u30fc\u30eb\u3092\u9001\u4fe1\u3059\u308b\u305f\u3081\u306b\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u611f\u3058\u3067MailKit.N &hellip; <a href=\"https:\/\/sumomo.ohwaki.jp\/wordpress\/?p=777\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18,9,31,32,4],"tags":[],"class_list":["post-777","post","type-post","status-publish","format-standard","hentry","category-net","category-c","category-linux","category-sendmail","category-4"],"_links":{"self":[{"href":"https:\/\/sumomo.ohwaki.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/777","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sumomo.ohwaki.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sumomo.ohwaki.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sumomo.ohwaki.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sumomo.ohwaki.jp\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=777"}],"version-history":[{"count":4,"href":"https:\/\/sumomo.ohwaki.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/777\/revisions"}],"predecessor-version":[{"id":781,"href":"https:\/\/sumomo.ohwaki.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/777\/revisions\/781"}],"wp:attachment":[{"href":"https:\/\/sumomo.ohwaki.jp\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=777"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sumomo.ohwaki.jp\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=777"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sumomo.ohwaki.jp\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=777"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}