{"id":15612694,"date":"2022-05-03T16:33:53","date_gmt":"2022-05-03T16:33:53","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/how-to-correctly-debug-smtp-issues-on-wordpress\/"},"modified":"2022-06-02T15:43:34","modified_gmt":"2022-06-02T15:43:34","slug":"how-to-correctly-debug-smtp-issues-on-wordpress","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/how-to-correctly-debug-smtp-issues-on-wordpress\/","title":{"rendered":"How to correctly debug SMTP Issues on WordPress?"},"content":{"rendered":"<p>Hi,<\/p>\n<p>I&#8217;m setting up mailing service in my site using AWS SES SMTP Interface, but I&#8217;m encountering issues. First, I assure that the credentials are correct. I checked them so many times. Second, I don&#8217;t want to use a plugin to setup SMTP Server because of resources usage, resources are very scarce! What complicates my life is the fact I&#8217;m unable to successfully debug SMTP errors, If I could do that I&#8217;d already fixed the issue.<\/p>\n<p>I&#8217;m trying to setup SMTP in my theme&#8217;s functions.php file<\/p>\n<pre><code>\/\/ SMTP email settings\n    define( &#039;SMTP_username&#039;, &#039;SMTP_USERNAME&#039; );  \/\/ username of host like Gmail\n    define( &#039;SMTP_password&#039;, &#039;SMTP_PASSWORD&#039; );   \/\/ password for login into the App\n    define( &#039;SMTP_server&#039;, &#039;email-smtp.us-east-1.amazonaws.com&#039; );     \/\/ SMTP server address\n    define( &#039;SMTP_FROM&#039;, &#039;BUSINESS_MAIL&#039; );   \/\/ Your Business Email Address\n    define( &#039;SMTP_NAME&#039;, &#039;SMTP_NAME&#039; );   \/\/  Business From Name\n    define( &#039;SMTP_PORT&#039;, &#039;587&#039; );     \/\/ Server Port Number\n    define( &#039;SMTP_SECURE&#039;, &#039;tls&#039; );   \/\/ Encryption - ssl or tls\n    define( &#039;SMTP_AUTH&#039;, true );  \/\/ Use SMTP authentication (true|false)\n    define( &#039;SMTP_DEBUG&#039;,   1 );  \/\/ for debugging purposes only&lt;code&gt;&lt;\/code&gt;\n\nadd_action( &#039;phpmailer_init&#039;, &#039;my_phpmailer_smtp&#039; );\n\tfunction my_phpmailer_smtp( $phpmailer ) {\n\t\t$phpmailer-&gt;isSMTP();     \n\t\t$phpmailer-&gt;Host = SMTP_server;  \n\t\t$phpmailer-&gt;SMTPAuth = SMTP_AUTH;\n\t\t$phpmailer-&gt;Port = SMTP_PORT;\n\t\t$phpmailer-&gt;Username = SMTP_username;\n\t\t$phpmailer-&gt;Password = SMTP_password;\n\t\t$phpmailer-&gt;SMTPSecure = SMTP_SECURE;\n\t\t$phpmailer-&gt;From = SMTP_FROM;\n\t\t$phpmailer-&gt;FromName = SMTP_NAME;\n\t}<\/code><\/pre>\n<p>I tried to set WP_DEGUG true in the file wp-config.php, but nothing. Does anyone know a better approach?<\/p>\n","protected":false},"template":"","class_list":["post-15612694","topic","type-topic","status-publish","hentry","topic-tag-aws","topic-tag-aws-ses","topic-tag-email","topic-tag-phpmailer"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/15612694","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":2,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/15612694\/revisions"}],"predecessor-version":[{"id":15703513,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/15612694\/revisions\/15703513"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=15612694"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}