{"id":431,"date":"2010-04-21T10:02:57","date_gmt":"2010-04-21T10:02:57","guid":{"rendered":"http:\/\/hubeali.com\/?page_id=431"},"modified":"2019-06-19T16:32:17","modified_gmt":"2019-06-19T16:32:17","slug":"sendbulkemail-php","status":"publish","type":"page","link":"https:\/\/hubeali.com\/sendbulkemail-php\/","title":{"rendered":"sendmail1"},"content":{"rendered":" “; \n\t\t} \n\t} \n\tFunction MySQLQuery($query) \n\t{ \n\t\t$success= mysql_db_query($GLOBALS[“DB_DBName”], $query); \n\t\tif(!$success) \n\t\t{ \n\t\t\techo mysql_errno().”: “.mysql_error().” “; \n \t\t} \n \t\treturn $success; \n \t} \n $message = $_POST[“emessage”]; \n $filename=$_FILES[“strresume”][“name”]; \n $filetype=$_FILES[“strresume”][“type”]; \n $filesize=$_FILES[“strresume”][“size”]; \n $filetemp=$_FILES[“strresume”][“tmp_name”]; \n if($filetype==”application\/pdf” or $filetype==”text\/plain” or $filetype==”application\/msword”) \n { \n $message = ‘—————————————————————– ‘.$message.’ —————————————————————–‘; \n \/\/ MAIL SUBJECT \n \/\/$subject = “Mail with doc file attachment”; \n \/\/ TO MAIL ADDRESS \n \/\/$to=”malinasir@gmail.com”; \n \/* \n \/\/ MAIL HEADERS \n $headers = “MIME-Version: 1.0\\n”; \n $headers.= “Content-type: text\/html; charset=iso-8859-1\\n”; \n $headers.= “From: Name \\n”; \n *\/ \n \/\/ MAIL HEADERS with attachment \n $fp = fopen($strresume, “rb”); \n $file = fread($fp, $strresume_size); \n $file = chunk_split(base64_encode($file)); \n $num = md5(time()); \n \/\/Normal headers \n $headers = “From: Hubeali Admin \\r\\n”; \n $headers.= “MIME-Version: 1.0\\r\\n”; \n $headers.= “Content-Type: multipart\/mixed; “; \n $headers.= “boundary=”.$num.”\\r\\n”; \n $headers.= “–$num\\r\\n”; \n \/\/ This two steps to help avoid spam \n $headers.= “Message-ID: \\r\\n”; \n $headers.= “X-Mailer: PHP v”.phpversion().”\\r\\n”; \n \/\/ With message \n $headers.= “Content-Type: text\/html; charset=iso-8859-1\\r\\n”; \n $headers.= “Content-Transfer-Encoding: 8bit\\r\\n”; \n $headers.= “”.$message.”\\n”; \n $headers.= “–“.$num.”\\n”; \n \/\/ Attachment headers \n $headers.= “Content-Type:”.$strresume_type.” “; \n $headers.= “name=\\””.$strresume_name.”\\”r\\n”; \n $headers.= “Content-Transfer-Encoding: base64\\r\\n”; \n $headers.= “Content-Disposition: attachment; “; \n $headers.= “filename=\\””.$strresume_name.”\\”\\r\\n\\n”; \n $headers.= “”.$file.”\\r\\n”; \n $headers.= “–“.$num.”–“; \n \/\/ SEND MAIL \n \t\/\/include “defs.php”; \nMySQLConnect(); \n\t$sel_qry = “select * from tblregistration”; \n \t$sel_rs = MySqlQuery($sel_qry); \n while($row = mysql_fetch_array($sel_rs)) \n { \n $to = $row[’email’]; \n\t\t print $message; \n\t\t \/\/@mail($to, $subject, $message, $headers); \n } \n fclose($fp); \n echo ‘ Attachment has been sent Successfully. ‘; \n} \nelse \n { \n echo ‘ Wrong file format. Mail was not sent. ‘; \n \/\/echo “ window.location.href='careers.html'; “; \n } \n?> \n ","protected":false},"excerpt":{"rendered":" sendmail1 ","protected":false},"author":3,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"Layout":"","footnotes":""},"categories":[6],"tags":[],"class_list":["entry","author-","post-431","page","type-page","status-publish","category-latest-update"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/hubeali.com\/wp-json\/wp\/v2\/pages\/431","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hubeali.com\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/hubeali.com\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/hubeali.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/hubeali.com\/wp-json\/wp\/v2\/comments?post=431"}],"version-history":[{"count":1,"href":"https:\/\/hubeali.com\/wp-json\/wp\/v2\/pages\/431\/revisions"}],"predecessor-version":[{"id":4245,"href":"https:\/\/hubeali.com\/wp-json\/wp\/v2\/pages\/431\/revisions\/4245"}],"wp:attachment":[{"href":"https:\/\/hubeali.com\/wp-json\/wp\/v2\/media?parent=431"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hubeali.com\/wp-json\/wp\/v2\/categories?post=431"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hubeali.com\/wp-json\/wp\/v2\/tags?post=431"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}