{"id":232696,"date":"2023-01-26T12:48:00","date_gmt":"2023-01-26T09:48:00","guid":{"rendered":"https:\/\/wordpress.mediadoma.com\/?p=232696"},"modified":"2023-02-04T17:40:45","modified_gmt":"2023-02-04T14:40:45","slug":"jak-virishiti-problemu-smtp-ne-vdalosja-projti-avtentifikaciju-za-dopomogoju-gmail-phpmailer","status":"publish","type":"post","link":"https:\/\/wordpress.mediadoma.com\/uk\/jak-virishiti-problemu-smtp-ne-vdalosja-projti-avtentifikaciju-za-dopomogoju-gmail-phpmailer\/","title":{"rendered":"\u042f\u043a \u0432\u0438\u0440\u0456\u0448\u0438\u0442\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 SMTP: \u043d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043f\u0440\u043e\u0439\u0442\u0438 \u0430\u0432\u0442\u0435\u043d\u0442\u0438\u0444\u0456\u043a\u0430\u0446\u0456\u044e \u0437\u0430 \u0434\u043e\u043f\u043e\u043c\u043e\u0433\u043e\u044e Gmail + PHPMailer?"},"content":{"rendered":"<p>\u041d\u0430\u0434\u0441\u0438\u043b\u0430\u043d\u043d\u044f \u0435\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u0457 \u043f\u043e\u0448\u0442\u0438 \u0447\u0435\u0440\u0435\u0437 PHPMailer \u0447\u0430\u0441\u0442\u043e \u0432\u0438\u043a\u043e\u043d\u0443\u0454\u0442\u044c\u0441\u044f \u0447\u0435\u0440\u0435\u0437 PHP, \u044f\u043a\u0449\u043e \u0432\u0438 \u043c\u0430\u0454\u0442\u0435 \u043d\u0430\u043c\u0456\u0440 \u043d\u0430\u0434\u0441\u0438\u043b\u0430\u0442\u0438 \u0441\u043f\u043e\u0432\u0456\u0449\u0435\u043d\u043d\u044f \u0435\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u044e \u043f\u043e\u0448\u0442\u043e\u044e \u043f\u0440\u043e \u043d\u043e\u0432\u0456 \u043a\u043e\u043c\u0435\u043d\u0442\u0430\u0440\u0456, \u043e\u0442\u0440\u0438\u043c\u0430\u043d\u0456 \u0443 \u0432\u0430\u0448\u043e\u043c\u0443 \u0431\u043b\u043e\u0437\u0456 WordPress, \u0430\u0431\u043e \u043a\u043e\u043b\u0438 \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u0435\u0440\u0435\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u0438\u0439 \u0432\u0438\u0441\u043e\u043a\u0438\u043c\u0438 \u0441\u0442\u0440\u0438\u0431\u043a\u0430\u043c\u0438 \u0426\u041f (\u0447\u0435\u0440\u0435\u0437 \u0447\u0430\u0441 \u0431\u0435\u0437\u0432\u0456\u0434\u043c\u043e\u0432\u043d\u043e\u0457 \u0440\u043e\u0431\u043e\u0442\u0438, \u0449\u043e \u043f\u043e\u043a\u0430\u0437\u0443\u0454 \u0441\u0435\u0440\u0435\u0434\u043d\u0454 \u043d\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0437\u0430 \u043e\u0441\u0442\u0430\u043d\u043d\u0456 1, 5 \u0456 15 \u0445\u0432\u0438\u043b\u0438\u043d).<\/p>\n<p>\u042f\u043a\u0449\u043e \u0432\u0438 \u043a\u043e\u0440\u0438\u0441\u0442\u0443\u0454\u0442\u0435\u0441\u044f Gmail, \u0448\u0432\u0438\u0434\u0448\u0435 \u0437\u0430 \u0432\u0441\u0435, Google GMail \u043f\u043e\u0432\u0456\u0434\u043e\u043c\u0438\u0442\u044c \u043f\u0440\u043e \u043f\u043e\u043c\u0438\u043b\u043a\u0443: \u041d\u0435\u043c\u043e\u0436\u043b\u0438\u0432\u043e \u0430\u0432\u0442\u0435\u043d\u0442\u0438\u0444\u0456\u043a\u0443\u0432\u0430\u0442\u0438, \u043d\u0430\u0432\u0456\u0442\u044c \u044f\u043a\u0449\u043e \u0432\u0438 \u0432\u0432\u0435\u043b\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0438\u0439 \u043f\u0430\u0440\u043e\u043b\u044c \u0434\u043b\u044f \u0441\u0432\u043e\u0433\u043e \u043e\u0431\u043b\u0456\u043a\u043e\u0432\u043e\u0433\u043e \u0437\u0430\u043f\u0438\u0441\u0443 Gmail.<\/p>\n<p>\u0420\u043e\u0437\u043c\u0456\u0449\u0443\u0432\u0430\u0442\u0438 \u043f\u0430\u0440\u043e\u043b\u044c \u043e\u0431\u043b\u0456\u043a\u043e\u0432\u043e\u0433\u043e \u0437\u0430\u043f\u0438\u0441\u0443 \u0431\u0435\u0437\u043f\u043e\u0441\u0435\u0440\u0435\u0434\u043d\u044c\u043e \u0434\u0435\u0441\u044c \u0443 \u0441\u0446\u0435\u043d\u0430\u0440\u0456\u0457 \u2013 \u043d\u0435 \u0434\u0443\u0436\u0435 \u0433\u0430\u0440\u043d\u0430 \u0456\u0434\u0435\u044f, \u0456 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0438\u0439 \u0441\u043f\u043e\u0441\u0456\u0431 \u0432\u0438\u0440\u0456\u0448\u0438\u0442\u0438 \u0446\u044e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0442\u0430 \u0443\u043d\u0438\u043a\u043d\u0443\u0442\u0438 \u0432\u0438\u0442\u043e\u043a\u0443 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u043f\u0430\u0440\u043e\u043b\u044f \u043e\u0431\u043b\u0456\u043a\u043e\u0432\u043e\u0433\u043e \u0437\u0430\u043f\u0438\u0441\u0443 \u2013 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0432\u0430\u0442\u0438 \u043f\u0430\u0440\u043e\u043b\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u0438. \u041a\u0440\u0456\u043c \u0442\u043e\u0433\u043e, \u0432\u0438 \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u0442\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438 \u0431\u0435\u0437\u043f\u0435\u043a\u0438 \u0434\u043b\u044f \u043c\u0435\u043d\u0448 \u0437\u0430\u0445\u0438\u0449\u0435\u043d\u0438\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c, \u0449\u043e \u043c\u043e\u0436\u0435 \u043d\u0435 \u043f\u0440\u0430\u0446\u044e\u0432\u0430\u0442\u0438, \u043e\u0441\u043a\u0456\u043b\u044c\u043a\u0438 \u0446\u0435 \u043b\u0438\u0448\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0456\u0439 PHP.<\/p>\n<p>\u041f\u0430\u0440\u043e\u043b\u044c \u0434\u043e\u0434\u0430\u0442\u043a\u0430 \u043c\u043e\u0436\u043d\u0430 \u0432\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0438 \u043e\u043a\u0440\u0435\u043c\u043e \u0434\u043b\u044f \u043a\u043e\u0436\u043d\u043e\u0457 \u043e\u043a\u0440\u0435\u043c\u043e\u0457 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u0438, \u0430 \u0442\u0430\u043a\u043e\u0436 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u0441\u0442\u0432\u043e\u0440\u0438\u0442\u0438 \u0439\u043e\u0433\u043e, \u044f\u043a\u0449\u043e \u0439\u043e\u0433\u043e \u0437\u043b\u0430\u043c\u0430\u043d\u043e.<\/p>\n<p>\u0412\u0430\u043c \u043f\u043e\u0442\u0440\u0456\u0431\u043d\u043e \u0431\u0443\u0434\u0435 \u0432\u0456\u0434\u0432\u0456\u0434\u0430\u0442\u0438 \u0456\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0456\u0439\u043d\u0443 \u043f\u0430\u043d\u0435\u043b\u044c \u0431\u0435\u0437\u043f\u0435\u043a\u0438 Google: <a href=\"https:\/\/myaccount.google.com\/security\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">https:\/\/myaccount.google.com\/security<\/a><\/p>\n<p><a href=\"https:\/\/wordpress.mediadoma.com\/wp-content\/uploads\/2022\/01\/post-155998-61e57292d0be9.jpg\" data-rel=\"lightbox\"><img decoding=\"async\" class=\"SDStudio-light-box-enable SDStudio-editor-tools-md-imp\" src=\"https:\/\/wordpress.mediadoma.com\/wp-content\/uploads\/2022\/01\/post-155998-61e57292d0be9.jpg\" alt=\"\u042f\u043a \u0432\u0438\u0440\u0456\u0448\u0438\u0442\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 SMTP: \u043d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043f\u0440\u043e\u0439\u0442\u0438 \u0430\u0432\u0442\u0435\u043d\u0442\u0438\u0444\u0456\u043a\u0430\u0446\u0456\u044e \u0437\u0430 \u0434\u043e\u043f\u043e\u043c\u043e\u0433\u043e\u044e Gmail + PHPMailer?\"><\/a><\/p>\n<p>google-app-passwords-security<\/p>\n<p>\u041f\u043e\u0442\u0456\u043c \u0434\u043e\u0434\u0430\u0439\u0442\u0435 \u043f\u0430\u0440\u043e\u043b\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u0438 (\u0432\u0438\u0431\u0435\u0440\u0456\u0442\u044c GMail \u0442\u0430 \u0456\u043d\u0448\u0456 \u2013 \u0434\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u0456 \u0456\u043c&#8217;\u044f) \u2013 \u044f\u043a\u0438\u0439 \u043c\u043e\u0436\u043d\u0430 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0432\u0430\u0442\u0438 \u0432 PHPMailer \u2013 \u0443 \u0432\u0438\u043f\u0430\u0434\u043a\u0443 \u0432\u0438\u0442\u043e\u043a\u0443 \u0446\u044c\u043e\u0433\u043e \u043f\u0430\u0440\u043e\u043b\u044f \u0432\u0438 \u0437\u0430\u0432\u0436\u0434\u0438 \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u0439\u043e\u0433\u043e \u0442\u0430 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u0441\u0442\u0432\u043e\u0440\u0438\u0442\u0438 \u043d\u043e\u0432\u0438\u0439.<\/p>\n<p><a href=\"https:\/\/wordpress.mediadoma.com\/wp-content\/uploads\/2022\/01\/post-155998-61e57294945ed.jpg\" data-rel=\"lightbox\"><img decoding=\"async\" class=\"SDStudio-light-box-enable SDStudio-editor-tools-md-imp\" src=\"https:\/\/wordpress.mediadoma.com\/wp-content\/uploads\/2022\/01\/post-155998-61e57294945ed.jpg\" alt=\"\u042f\u043a \u0432\u0438\u0440\u0456\u0448\u0438\u0442\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 SMTP: \u043d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043f\u0440\u043e\u0439\u0442\u0438 \u0430\u0432\u0442\u0435\u043d\u0442\u0438\u0444\u0456\u043a\u0430\u0446\u0456\u044e \u0437\u0430 \u0434\u043e\u043f\u043e\u043c\u043e\u0433\u043e\u044e Gmail + PHPMailer?\"><\/a><\/p>\n<p>\u043f\u0430\u0440\u043e\u043b\u0456 \u0434\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u0438 google<\/p>\n<p>\u041f\u043e\u0442\u0456\u043c \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0443\u0432\u0430\u043d\u043d\u044f \u0435\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u0457 \u043f\u043e\u0448\u0442\u0438 \u0441\u043b\u0456\u0434 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u0430\u0442\u0438 \u043d\u0430\u0432\u0435\u0434\u0435\u043d\u0438\u0439 \u043d\u0438\u0436\u0447\u0435 \u043f\u0440\u0438\u043a\u043b\u0430\u0434 \u043a\u043e\u0434\u0443 <a href=\"https:\/\/helloacm.com\/send-emails-using-crontab-for-your-web-applications\/\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">PHPMailer .<\/a><\/p>\n<pre><code>#!\/usr\/bin\/php\n&lt;?php\n\u00a0 use PHPMailerPHPMailerPHPMailer;\n\u00a0 use PHPMailerPHPMailerException;\n\u00a0 \n\u00a0 require 'PHPMailer\/src\/Exception.php';\n\u00a0 require 'PHPMailer\/src\/PHPMailer.php';\n\u00a0 require 'PHPMailer\/src\/SMTP.php';\n\u00a0\n\u00a0 $host = \"&lt;a class=\"vglnk\" target=\"_blank\" href=\"http:\/\/smtp.gmail.com\" rel=\"nofollow\"&gt;&lt;span&gt;smtp&lt;\/span&gt;&lt;span&gt;.&lt;\/span&gt;&lt;span&gt;gmail&lt;\/span&gt;&lt;span&gt;.&lt;\/span&gt;&lt;span&gt;com&lt;\/span&gt;&lt;\/a&gt;\";\n\u00a0 $port = 587;\n\u00a0 $secure = \"tls\";\n\/\/ \u00a0or the following configurations through SSL should work as well. \n\/\/ \u00a0$port = 465;\n\/\/ \u00a0$secure = \"ssl\";\n\u00a0 $username = \"Your GMAIL email\";\n\u00a0 $password = \"Your GMAIL App Password\";\n\u00a0 \n\u00a0 try {\n\u00a0 \u00a0 $mailer = new PHPMailer(true);\n\u00a0 \u00a0 $mailer-&gt;IsHTML(true);\n\u00a0 \u00a0 $mailer-&gt;IsSMTP();\n\u00a0 \u00a0 $mailer-&gt;From = $username;\n\u00a0 \u00a0 $mailer-&gt;FromName = $username;\n\u00a0 \u00a0 $mailer-&gt;ClearAllRecipients();\n\u00a0 \u00a0 $mailer-&gt;AddAddress(\"Recipent Email Address\", \"Recipent\");\n\u00a0 \u00a0 $mailer-&gt;Subject = \"Subject \";\n\u00a0 \u00a0 $mailer-&gt;Body = \"Hello, time is: \". date(\"Y-m-d h:i:s\");\n\u00a0 \u00a0 $mailer-&gt;SMTPAuth \u00a0 = true; \u00a0 \u00a0 \u00a0 \/\/ enable SMTP authentication\n\u00a0 \u00a0 $mailer-&gt;SMTPSecure = $secure; \u00a0 \u00a0\/\/ sets the prefix to the servier\n\u00a0 \u00a0 $mailer-&gt;Host \u00a0 \u00a0 \u00a0 = $host; \u00a0 \u00a0 \u00a0\/\/ sets GMAIL as the SMTP server\n\u00a0 \u00a0 $mailer-&gt;Port \u00a0 \u00a0 \u00a0 = $port; \u00a0 \u00a0 \u00a0\/\/ set the SMTP port for the GMAIL server\n\u00a0 \u00a0 $mailer-&gt;Username \u00a0 = $username; \u00a0\/\/ GMAIL username\n\u00a0 \u00a0 $mailer-&gt;Password \u00a0 = $password; \u00a0\/\/ GMAIL password\n\u00a0 \u00a0 $result = $mailer-&gt;Send();\u00a0 \n\u00a0 \u00a0 echo \"Mail sentn\";\n\u00a0 } catch \u00a0(Exception $e) {\n\u00a0 \u00a0 echo 'Message could not be sent. Mailer Error: ';\n\u00a0 \u00a0 var_dump($e);\n\u00a0 } \u00a0<\/code><\/pre>\n<p>\u041f\u0430\u043c\u2019\u044f\u0442\u0430\u0439\u0442\u0435, \u0449\u043e \u0432\u0430\u043c \u0442\u0430\u043a\u043e\u0436 \u043f\u043e\u0442\u0440\u0456\u0431\u043d\u043e \u0431\u0443\u0434\u0435 \u043e\u043d\u043e\u0432\u0438\u0442\u0438 \u043d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u043d\u043d\u044f \u0435\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u0457 \u043f\u043e\u0448\u0442\u0438 \u0432 \u043f\u043b\u0430\u0433\u0456\u043d\u0456 WordPress \u2013 <a href=\"https:\/\/wordpress.mediadoma.com\/uk\/jak-uniknuti-potrapljannja-elektronnih-listiv-wordpress-u-papku-spamu\/\" title=\"SMTP\">SMTP<\/a>. \u041f\u0435\u0440\u0435\u043a\u043e\u043d\u0430\u0439\u0442\u0435\u0441\u044f, \u0449\u043e \u0443 \u0444\u0430\u0439\u043b\u0456 wp-settings.php \u043e\u043d\u043e\u0432\u043b\u0435\u043d\u043e \u043d\u0430\u0441\u0442\u0443\u043f\u043d\u0456 \u043e\u0431\u043b\u0456\u043a\u043e\u0432\u0456 \u0434\u0430\u043d\u0456 \u0434\u043b\u044f Gmail<\/p>\n<pre><code>define( 'WPMS_ON', true );\ndefine( 'WPMS_SMTP_PASS', 'You GMAIL App Password' );<\/code><\/pre>\n<p><div id=\"PostUnique_PostSource\" style=\"padding-top: 50px\">\u0414\u0436\u0435\u0440\u0435\u043b\u043e \u0437\u0430\u043f\u0438\u0441\u0443:  <a target=\"_blank\" rel=\"noopener nofollow\" href=\"\/\/helloacm.com\" class=\"external external_icon\">helloacm.com<\/a><\/div><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u042f\u043a \u0432\u0438\u0440\u0456\u0448\u0438\u0442\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 SMTP: \u043d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043f\u0440\u043e\u0439\u0442\u0438 \u0430\u0432\u0442\u0435\u043d\u0442\u0438\u0444\u0456\u043a\u0430\u0446\u0456\u044e \u0437\u0430 \u0434\u043e\u043f\u043e\u043c\u043e\u0433\u043e\u044e Gmail + PHPMailer?<\/p>\n","protected":false},"author":1,"featured_media":224603,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_wp_rev_ctl_limit":""},"categories":[953,902,849,923],"tags":[1174],"class_list":["post-232696","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-google-10","category-kod-3","category-pidruchnyky","category-inshyj","tag-affiai-uk"],"_links":{"self":[{"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/posts\/232696","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/comments?post=232696"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/posts\/232696\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/media\/224603"}],"wp:attachment":[{"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/media?parent=232696"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/categories?post=232696"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/uk\/wp-json\/wp\/v2\/tags?post=232696"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}