{"id":628,"date":"2017-06-11T16:20:27","date_gmt":"2017-06-11T09:20:27","guid":{"rendered":"https:\/\/vannamit.com\/?p=628"},"modified":"2017-06-11T16:20:27","modified_gmt":"2017-06-11T09:20:27","slug":"code-spam-mail-bang-php-php-phpmailer","status":"publish","type":"post","link":"https:\/\/khowordpress.com\/vannamit\/code-spam-mail-bang-php-php-phpmailer\/","title":{"rendered":"Code spam mail b\u1eb1ng php + PHp PHPMailer"},"content":{"rendered":"<p>C\u00f3 nhi\u1ec1u b\u1ea1n ch\u1eafc \u0111\u00e3 bi\u1ebft \u0111\u1ebfn sendgrid. \u0110\u00f3 l\u00e0 m\u1ed9t h\u1ec7 th\u1ed1ng hi\u1ec7n \u0111ang cho ph\u00e9p t\u00e0i kho\u1ea3n mi\u1ec5n ph\u00ed \u0111\u0103ng k\u00fd s\u1eed d\u1ee5ng 12k email\/ th\u00e1ng<\/p>\n<p>V\u00e0 sau \u0111\u00e2y m\u00ecnh xin chia s\u1ebb code spam email b\u1eb1ng php<\/p>\n<p>Code n\u00e0y gi\u00fap ch\u00fang ta g\u1eedi m\u1ed9t s\u1ed1 l\u01b0\u1ee3ng email l\u1edbn \u0111\u1ebfn victim. C\u00f3 th\u1ec3 tu\u1ef3 bi\u1ebfn \u0111\u1ec3 g\u1eedi email \u0111\u1ebfn nhi\u1ec1u victim tu\u1ef3 \u00fd b\u1ea1n<\/p>\n<p>&nbsp;<\/p>\n<pre>&lt;?php\n date_default_timezone_set(\"America\/New_York\");\n\ninclude \"class.phpmailer.php\"; \n include \"class.smtp.php\"; \n $mail = new PHPMailer(); \/\/Khai b\u00e1o g\u1eedi mail b\u1eb1ng SMTP\n $mail-&gt;IsSMTP(); \n \/\/T\u1eaft m\u1edf ki\u1ec3m tra l\u1ed7i tr\u1ea3 v\u1ec1, ch\u1ea5p nh\u1eadn c\u00e1c gi\u00e1 tr\u1ecb 0 1 2\n \/\/ 0 = off kh\u00f4ng th\u00f4ng b\u00e1o b\u1ea5t k\u00ec g\u00ec, t\u1ed1t nh\u1ea5t n\u00ean d\u00f9ng khi \u0111\u00e3 ho\u00e0n th\u00e0nh.\n \/\/ 1 = Th\u00f4ng b\u00e1o l\u1ed7i \u1edf client\n \/\/ 2 = Th\u00f4ng b\u00e1o l\u1ed7i c\u1ea3 client v\u00e0 l\u1ed7i \u1edf server\n $mail-&gt;SMTPDebug = 1;\n $mail-&gt;Host = \"smtp.sendgrid.net\"; \/\/ server g\u1eedi - c\u00f3 th\u1ec3 d\u00f9ng gmail, yahoo tu\u1ef3 b\u1ea1n\n $mail-&gt;Port = 465; \/\/ c\u1ed5ng \u0111\u1ec3 g\u1eedi mail\n $mail-&gt;SMTPAuth = true; \/\/X\u00e1c th\u1ef1c SMTP\n $mail-&gt;SMTPSecure = 'ssl'; \/\/Ph\u01b0\u01a1ng th\u1ee9c m\u00e3 h\u00f3a th\u01b0 - ssl ho\u1eb7c tls\n $mail-&gt;Username = \"tntonline\"; \/\/ T\u00ean \u0111\u0103ng nh\u1eadp \n $mail-&gt;Password = \"*******\"; \/\/ M\u1eadt kh\u1ea9u\n $mail-&gt;From = 'emailcuaban@gmail.com'; \/\/ Th\u00f4ng tin mail g\u1eedi \n( c\u00e1i n\u00e0y ng\u01b0\u1eddi nh\u1eadn s\u1ebd nh\u00ecn th\u1ea5y - mail kh\u00f4ng t\u1ed3n t\u1ea1i c\u0169ng dc)\n $mail-&gt;FromName = 'Thomas Lange ' .mktime() ; \/\/ t\u00ean ng\u01b0\u1eddi g\u1eedi + \u0111\u00e3 l\u1ea5y th\u1eddi gian \u0111\u1ec3 tr\u00e1nh l\u1eb7p t\u00ean\n $mail-&gt;AddAddress(\"gblack2527@msn.com\");\/\/ mail nh\u1eadn\n $mail-&gt;WordWrap = 50; \n $mail-&gt;IsHTML(true); \n \n \n \n $mail-&gt;Subject = 'your code promo is ' . mktime(); \/\/ ng\u1eabu nhi\u00ean ti\u00eau \u0111\u1ec1 tr\u00e1nh b\u1ecb v\u00e0o chung (gmail)\n \n $mail-&gt;Body = 'N\u1ed9i dung email ' ;\n \/\/ v\u00f2ng l\u1eb7p cho bi\u1ebfn i ch\u1ea1y t\u1eeb 1 \u0111\u1ebfn 5\n \n for( $i = 1; $i &lt;= 5; $i++ ) {\n \n if(!$mail-&gt;Send()) {\n echo \"C\u00f3 l\u1ed7i khi g\u1eedi mail &lt;br&gt;\";\n } else {\n \n echo \"\u0110\u00e3 g\u1eedi th\u01b0 th\u00e0nh c\u00f4ng \" .$i .\" mail\". \"&lt;br&gt;\";\n \n }\n \n }\n?&gt;<\/pre>\n<p>M\u00ecnh ch\u1ec9 vi\u1ebft code c\u01a1 b\u1ea3n th\u00f4i c\u00f2n m\u1ecdi ng\u01b0\u1eddi c\u00f3 th\u1ec3 nghi\u00ean c\u1ee9u s\u00e2u h\u01a1n b\u1eb1ng c\u00e1ch t\u1ea1o ra 1 form cho ph\u00e9p nh\u1eadp email g\u1eedi , email nh\u1eadn, s\u1ed1 l\u01b0\u1ee3ng email g\u1eedi \u0111\u1ebfn \u0111\u1ed1i t\u01b0\u1ee3ng<\/p>\n<p>Ch\u00fac m\u1ecdi ng\u01b0\u1eddi th\u00e0nh c\u00f4ng!<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-263\" src=\"http:\/\/vannamit.com\/blog\/wp-content\/uploads\/2017\/04\/download.png\" alt=\"download\" width=\"330\" height=\"60\" srcset=\"https:\/\/khowordpress.com\/vannamit\/wp-content\/uploads\/2017\/04\/download.png 330w, https:\/\/khowordpress.com\/vannamit\/wp-content\/uploads\/2017\/04\/download-300x55.png 300w, https:\/\/khowordpress.com\/vannamit\/wp-content\/uploads\/2017\/04\/download-324x60.png 324w\" sizes=\"auto, (max-width: 330px) 100vw, 330px\" \/><\/p>\n<p><a href=\"https:\/\/drive.google.com\/file\/d\/0B5TNK5I0dIs1eV9fN0tGNEpmM2c\/view?usp=sharing\">https:\/\/drive.google.com\/file\/d\/0B5TNK5I0dIs1eV9fN0tGNEpmM2c\/view?usp=sharing<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>C\u00f3 nhi\u1ec1u b\u1ea1n ch\u1eafc \u0111\u00e3 bi\u1ebft \u0111\u1ebfn sendgrid. \u0110\u00f3 l\u00e0 m\u1ed9t h\u1ec7 th\u1ed1ng hi\u1ec7n \u0111ang cho ph\u00e9p t\u00e0i kho\u1ea3n mi\u1ec5n ph\u00ed \u0111\u0103ng k\u00fd s\u1eed d\u1ee5ng&#8230;<\/p>\n","protected":false},"author":1,"featured_media":629,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-628","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-share"],"_links":{"self":[{"href":"https:\/\/khowordpress.com\/vannamit\/wp-json\/wp\/v2\/posts\/628","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/khowordpress.com\/vannamit\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/khowordpress.com\/vannamit\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/khowordpress.com\/vannamit\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/khowordpress.com\/vannamit\/wp-json\/wp\/v2\/comments?post=628"}],"version-history":[{"count":0,"href":"https:\/\/khowordpress.com\/vannamit\/wp-json\/wp\/v2\/posts\/628\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/khowordpress.com\/vannamit\/wp-json\/wp\/v2\/media\/629"}],"wp:attachment":[{"href":"https:\/\/khowordpress.com\/vannamit\/wp-json\/wp\/v2\/media?parent=628"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/khowordpress.com\/vannamit\/wp-json\/wp\/v2\/categories?post=628"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/khowordpress.com\/vannamit\/wp-json\/wp\/v2\/tags?post=628"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}