{"id":32735,"date":"2023-02-09T15:07:17","date_gmt":"2023-02-09T15:07:17","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=32735"},"modified":"2023-02-09T15:10:29","modified_gmt":"2023-02-09T15:10:29","slug":"how-to-see-number-of-emails-sent-using-smtp-in-laravel","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/how-to-see-number-of-emails-sent-using-smtp-in-laravel\/","title":{"rendered":"How to see number of emails sent using smtp in laravel"},"content":{"rendered":"\n<p>To see the number of emails sent using SMTP in Laravel, you can look for log entries in your Laravel application&#8217;s logs that indicate email messages have been sent.<\/p>\n\n\n\n<p>For example, you could use the following command to search for log entries containing the string &#8220;Sent Email&#8221; in the file &#8220;laravel.log&#8221;:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ cd \/opt\/lampp\/htdocs\n$ <code>grep -c \"Sent Email\" laravel.log\n<\/code>$ grep -r -i --include=\"*.log\" -o \"smtp\" . | wc -l\n$ grep -r --include=\"*.log\" -o \"email-smtp.ap-south-1.amazonaws.com\" . | wc -l<\/pre>\n\n\n\n<p>Explanation:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>grep<\/code> searches for the specified string in the file<\/li>\n\n\n\n<li><code>-c<\/code> flag only prints the count of matching lines, rather than the lines themselves<\/li>\n<\/ul>\n\n\n\n<p>This command will give you a count of the number of log entries containing the string &#8220;Sent Email&#8221;, which would indicate that an email was sent.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To see the number of emails sent using SMTP in Laravel, you can look for log entries in your Laravel application&#8217;s logs that indicate email messages have been sent. For example, you could use the following command to search for log entries containing the string &#8220;Sent Email&#8221; in the file &#8220;laravel.log&#8221;: $ cd \/opt\/lampp\/htdocs $&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","_joinchat":[],"footnotes":""},"categories":[2],"tags":[],"class_list":["post-32735","post","type-post","status-publish","format-standard","hentry","category-uncategorised"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/32735","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=32735"}],"version-history":[{"count":3,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/32735\/revisions"}],"predecessor-version":[{"id":32738,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/32735\/revisions\/32738"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=32735"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=32735"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=32735"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}