{"id":6431,"date":"2024-08-30T11:37:16","date_gmt":"2024-08-30T02:37:16","guid":{"rendered":"https:\/\/taitan916.info\/blog\/?p=6431"},"modified":"2024-05-30T22:59:19","modified_gmt":"2024-05-30T13:59:19","slug":"post-6431","status":"publish","type":"post","link":"https:\/\/taitan916.info\/blog\/archives\/6431","title":{"rendered":"JavaScript\u3067\u30e1\u30fc\u30eb\u9001\u4fe1\u3092\u884c\u3048\u308b\u300cEmailJS\u300d\u306e\u5229\u7528\u65b9\u6cd5"},"content":{"rendered":"<p>\u304a\u554f\u3044\u5408\u308f\u305b\u30d5\u30a9\u30fc\u30e0\u7b49\u306e\u8a18\u5165\u5185\u5bb9\u3092\u30e1\u30fc\u30eb\u3067\u9001\u4fe1\u3059\u308b\u969b\u3001\u901a\u5e38\u306fPHP\u7b49\u30b5\u30fc\u30d0\u30b5\u30a4\u30c9\u306e\u8a00\u8a9e\u3067\u5bfe\u5fdc\u3059\u308b\u3053\u3068\u306b\u306a\u308b\u3002\u3053\u308c\u3092JavaScript\u3067\u4f55\u3068\u304b\u306a\u3044\u304b\u3068\u8abf\u3079\u305f\u3068\u3053\u308d\u300cEmailJS\u300d\u3068\u3044\u3046\u30b5\u30fc\u30d3\u30b9\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u3067\u5bfe\u5fdc\u3067\u304d\u308b\u3089\u3057\u3044\u3002\u8a2d\u5b9a\u65b9\u6cd5\u3084\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u7b49\u3092\u4ee5\u4e0b\u306b\u30e1\u30e2\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>EmailJS<\/h2>\n<h3>\u516c\u5f0f\u30b5\u30a4\u30c8<\/h3>\n<p><a href=\"https:\/\/www.emailjs.com\/\" target=\"_blank\" rel=\"noopener\">https:\/\/www.emailjs.com\/<\/a><\/p>\n<h3>\u5229\u7528\u6599\u91d1<\/h3>\n<p><a href=\"https:\/\/www.emailjs.com\/pricing\/\" target=\"_blank\" rel=\"noopener\">\u3053\u3061\u3089\u306e\u30da\u30fc\u30b8<\/a>\u306b\u3088\u308b\u3068\u300c200\u30ea\u30af\u30a8\u30b9\u30c8 \/ \u6708\u300d\u307e\u3067\u306f\u7121\u6599\u3067\u5229\u7528\u53ef\u3002\u305d\u308c\u4ee5\u4e0a\u3068\u306a\u308b\u3068\u6709\u6599\u306b\u306a\u308b\u70b9\u306b\u6ce8\u610f\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>\u4e8b\u524d\u6e96\u5099<\/h2>\n<h3>\u30a2\u30ab\u30a6\u30f3\u30c8\u4f5c\u6210\u53ca\u3073\u30ed\u30b0\u30a4\u30f3<\/h3>\n<p><a href=\"https:\/\/dashboard.emailjs.com\/sign-up\" target=\"_blank\" rel=\"noopener\">\u3053\u3061\u3089\u306e\u30da\u30fc\u30b8<\/a>\u3088\u308a\u30a2\u30ab\u30a6\u30f3\u30c8\u4f5c\u6210\u3092\u884c\u3063\u3066\u304a\u304d\u30c0\u30c3\u30b7\u30e5\u30dc\u30fc\u30c9\u306b\u30ed\u30b0\u30a4\u30f3\u3059\u308b\u3002<\/p>\n<h3>Email \u30b5\u30fc\u30d3\u30b9\u9023\u643a<\/h3>\n<p><a href=\"https:\/\/dashboard.emailjs.com\/admin\" target=\"_blank\" rel=\"noopener\">\u3053\u3061\u3089\u306e\u30da\u30fc\u30b8<\/a>\u3088\u308a\u5229\u7528\u3059\u308bEmail\u30b5\u30fc\u30d3\u30b9\u3068\u9023\u643a\u8a2d\u5b9a\u3092\u884c\u3046\u3002<\/p>\n<p>\u3061\u306a\u307f\u306bGmail\u3092\u9078\u629e\u3057\u300cConnect Account\u300d\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068Google\u3078\u306e\u30ed\u30b0\u30a4\u30f3\u304c\u4fc3\u3055\u308c\u308b\u306e\u3067\u30ed\u30b0\u30a4\u30f3\u3057\u3001\u5143\u306e\u30da\u30fc\u30b8\u306b\u623b\u3063\u305f\u3089\u300cCreate Service\u300d\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u9023\u643a\u304c\u5b8c\u4e86\u3059\u308b\u3002<\/p>\n<p>\u5c1a\u3001\u9023\u643a\u304c\u5b8c\u4e86\u3059\u308b\u3068\u300cService ID\u300d\u304c\u767a\u884c\u3055\u308c\u308b\u306e\u3067\u30e1\u30e2\u3057\u3066\u304a\u304f\u3002<\/p>\n<h3>\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u4f5c\u6210<\/h3>\n<p><a href=\"https:\/\/dashboard.emailjs.com\/admin\/templates\" target=\"_blank\" rel=\"noopener\">\u3053\u3061\u3089\u306e\u30da\u30fc\u30b8<\/a>\u3088\u308a\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u4f5c\u6210\u3059\u308b\u3002\u4f5c\u6210\u5f8c\u3001\u300cTemplate ID\u300d\u304c\u767a\u884c\u3055\u308c\u308b\u306e\u3067\u30e1\u30e2\u3057\u3066\u304a\u304f\u3002<\/p>\n<h3>Public Key\u306e\u53d6\u5f97<\/h3>\n<p><a href=\"https:\/\/dashboard.emailjs.com\/admin\/account\" target=\"_blank\" rel=\"noopener\">\u3053\u3061\u3089\u306e\u30da\u30fc\u30b8<\/a>\u306e\u300cAPI keys\u300d\u5185\u306b\u300cPublic key\u300d\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u7b48\u306a\u306e\u3067\u30e1\u30e2\u3057\u3066\u304a\u304f\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>\u30d5\u30a9\u30fc\u30e0\u306e\u4f5c\u6210<\/h2>\n<p><a href=\"https:\/\/www.emailjs.com\/docs\/tutorial\/creating-contact-form\/\" target=\"_blank\" rel=\"noopener\">\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8<\/a>\u3092\u53c2\u8003\u306e\u4e0a\u3001\u4ee5\u4e0b\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3057\u3066\u304a\u304f\u3002\u5c1a\u3001\u3010Public Key\u3011\u3010Email Services\u306eID\u3011\u3010Email Templates\u306eID\u3011\u306f\u30e1\u30e2\u3057\u305f\u3082\u306e\u306b\u66f8\u304d\u63db\u3048\u308b\u3053\u3068\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;title&gt;Contact Form&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n    &lt;form id=\"contact-form\"&gt;\r\n        &lt;input type=\"hidden\" name=\"contact_number\"&gt;\r\n        &lt;label&gt;Name&lt;\/label&gt;\r\n        &lt;input type=\"text\" name=\"user_name\"&gt;\r\n        &lt;label&gt;Email&lt;\/label&gt;\r\n        &lt;input type=\"email\" name=\"user_email\"&gt;\r\n        &lt;label&gt;Message&lt;\/label&gt;\r\n        &lt;textarea name=\"message\"&gt;&lt;\/textarea&gt;\r\n        &lt;input type=\"submit\" value=\"Send\"&gt;\r\n    &lt;\/form&gt;\r\n    &lt;script type=\"text\/javascript\" src=\"https:\/\/cdn.jsdelivr.net\/npm\/@emailjs\/browser@4\/dist\/email.min.js\"&gt;&lt;\/script&gt;\r\n    &lt;script type=\"text\/javascript\"&gt;\r\n    (function() {\r\n        emailjs.init({\r\n            publicKey: \"\u3010Public Key\u3011\",\r\n        });\r\n    })();\r\n\r\n    window.onload = function() {\r\n        document.getElementById('contact-form').addEventListener('submit', function(event) {\r\n            event.preventDefault();\r\n            emailjs.sendForm('\u3010Email Services\u306eID\u3011', '\u3010Email Templates\u306eID\u3011', this).then(function() {\r\n                console.log('SUCCESS!');\r\n            }, function(error) {\r\n                console.log('FAILED...', error);\r\n            });\r\n        });\r\n    }\r\n    &lt;\/script&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>&nbsp;<\/p>\n<h2>\u30e1\u30fc\u30eb\u53d7\u4fe1\u306b\u3064\u3044\u3066<\/h2>\n<p>\u30e1\u30fc\u30eb\u306e\u53d7\u4fe1\u306b\u3064\u3044\u3066\u306f<a href=\"https:\/\/dashboard.emailjs.com\/admin\/history\" target=\"_blank\" rel=\"noopener\">\u30c0\u30c3\u30b7\u30e5\u30dc\u30fc\u30c9\u306e\u3053\u306e\u30da\u30fc\u30b8<\/a>\u3067\u78ba\u8a8d\u3067\u304d\u308b\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>\u6240\u611f<\/h2>\n<p>\u7121\u6599\u67a0\u306f\u300c200\u30ea\u30af\u30a8\u30b9\u30c8 \/ \u6708\u300d\u3068\u82e5\u5e72\u5236\u9650\u304c\u53b3\u3057\u3044\u3082\u306e\u306e\u3001ASP\u7b49\u306ePHP\u5229\u7528\u4e0d\u53ef\u306e\u74b0\u5883\u3060\u3068\u9078\u629e\u80a2\u306e\u4e00\u3064\u3068\u3057\u3066\u3042\u308a\u304b\u3082\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u304a\u554f\u3044\u5408\u308f\u305b\u30d5\u30a9\u30fc\u30e0\u7b49\u306e\u8a18\u5165\u5185\u5bb9\u3092\u30e1\u30fc\u30eb\u3067\u9001\u4fe1\u3059\u308b\u969b\u3001\u901a\u5e38\u306fPHP\u7b49\u30b5\u30fc\u30d0\u30b5\u30a4\u30c9 ... <\/p>\n","protected":false},"author":1,"featured_media":1067,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-6431","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-javascript"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/posts\/6431","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/comments?post=6431"}],"version-history":[{"count":2,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/posts\/6431\/revisions"}],"predecessor-version":[{"id":6433,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/posts\/6431\/revisions\/6433"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/media\/1067"}],"wp:attachment":[{"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/media?parent=6431"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/categories?post=6431"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/taitan916.info\/blog\/wp-json\/wp\/v2\/tags?post=6431"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}