{"id":70055,"date":"2021-08-24T04:10:06","date_gmt":"2021-08-24T08:10:06","guid":{"rendered":"http:\/\/bangla.salearningschool.com\/recent-posts\/emailing-in-php-use-php-mailer-package-16\/"},"modified":"2021-08-24T04:10:06","modified_gmt":"2021-08-24T08:10:06","slug":"emailing-in-php-use-php-mailer-package-16","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=70055","title":{"rendered":"Emailing in PHP: use PHP Mailer Package #16"},"content":{"rendered":"\n<ul>\n<li> Download PHPMailer Package from: http:\/\/sourceforge.net\/project\/showfiles.php?group_id=26031     <\/li>\n<li> Unzip=install     <\/li>\n<li> In the class &#8220;class.smtp.php&#8221;, there is a send method that can be used to send emails     <\/li>\n<li> PHPMailer provides different ways of mailing: default php mail function [capabilities limited], Using a SMTP server [with or without authentication], using Sendmail software     <\/li>\n<li> PHP mailer can attach files, can send HTML emails     <\/li>\n<li>  In the class &#8220;class.smtp.php&#8221;, you can write a function that can use send method to send emails. Your method can take parameters to set mailing parameters. Callers will supply the parameters.    <\/li>\n<li> A sample method can be as follows: <\/li>\n<\/ul>\n<pre>    public function prepareAndSendMail($fields){                date_default_timezone_set('America\/Toronto');               $this-&gt;IsSMTP();     $this-&gt;IsHTML(true); \/\/ send as HTML     $this-&gt;SMTPAuth   = true;                  \/\/ enable SMTP authentication     $this-&gt;SMTPSecure = \"ssl\";                 \/\/ sets the prefix to the servier     $this-&gt;Host       = \"SMTP server address\"; \/\/ set SMTP server        $this-&gt;Port       = port usually 25 or 465;\/\/ set the SMTP port              $this-&gt;Username   = \"user name for smtp server\"; \/\/ smtp server username     $this-&gt;Password   = \"user password\"; \/\/ smtp server password             $this-&gt;AddReplyTo(\"reply to email address\",\"\");              $this-&gt;From       = \"email address to send from\";        $this-&gt;FromName   = \"sender's name\";             $this-&gt;Subject    = \"subject of the email\";              \/\/$this-&gt;Body       = \"Hi, This is the HTML BODY<br \/>\";     $this-&gt;AltBody    = $fields[\"altBody\"]; \/\/non-html body      $this-&gt;WordWrap   = 50; \/\/ set word wrap             $this-&gt;MsgHTML($fields[\"body\"]);             $this-&gt;AddAddress($fields[\"to\"]);                $this-&gt;AddAttachment($fields[\"attachment\"]); \/\/ attachment                               if(!$this-&gt;Send()) {       echo \"Mailer Error: \" . $this-&gt;ErrorInfo;      } else {          echo \"Message sent!\";     }               }<\/pre>\n<p>From: http:\/\/sitestree.com\/?p=5128<br \/> Categories:16<br \/>Tags:<br \/> Post Data:2010-12-19 23:49:23<\/p>\n<pre><code>    Shop Online: &lt;a href='https:\/\/www.ShopForSoul.com\/' target='new' rel=\"noopener\"&gt;https:\/\/www.ShopForSoul.com\/&lt;\/a&gt;\n    (Big Data, Cloud, Security, Machine Learning): Courses: &lt;a href='http:\/\/Training.SitesTree.com' target='new' rel=\"noopener\"&gt; http:\/\/Training.SitesTree.com&lt;\/a&gt; \n    In Bengali: &lt;a href='http:\/\/Bangla.SaLearningSchool.com' target='new' rel=\"noopener\"&gt;http:\/\/Bangla.SaLearningSchool.com&lt;\/a&gt;\n    &lt;a href='http:\/\/SitesTree.com' target='new' rel=\"noopener\"&gt;http:\/\/SitesTree.com&lt;\/a&gt;\n    8112223 Canada Inc.\/JustEtc: &lt;a href='http:\/\/JustEtc.net' target='new' rel=\"noopener\"&gt;http:\/\/JustEtc.net (Software\/Web\/Mobile\/Big-Data\/Machine Learning) &lt;\/a&gt;\n    Shop Online: &lt;a href='https:\/\/www.ShopForSoul.com'&gt; https:\/\/www.ShopForSoul.com\/&lt;\/a&gt;\n    Medium: &lt;a href='https:\/\/medium.com\/@SayedAhmedCanada' target='new' rel=\"noopener\"&gt; https:\/\/medium.com\/@SayedAhmedCanada &lt;\/a&gt;\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Download PHPMailer Package from: http:\/\/sourceforge.net\/project\/showfiles.php?group_id=26031 Unzip=install In the class &#8220;class.smtp.php&#8221;, there is a send method that can be used to send emails PHPMailer provides different ways of mailing: default php mail function [capabilities limited], Using a SMTP server [with or without authentication], using Sendmail software PHP mailer can attach files, can send HTML emails In &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=70055\">Continue reading<\/a><\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1917],"tags":[],"class_list":["post-70055","post","type-post","status-publish","format-standard","hentry","category-fromsitestree-com","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":7749,"url":"http:\/\/bangla.sitestree.com\/?p=7749","url_meta":{"origin":70055,"position":0},"title":"PHP \u09a4\u09c7 \u0987\u09ae\u09c7\u0987\u09b2\u09bf\u0982 : PHPMailer \u09aa\u09cd\u09af\u09be\u0995\u09c7\u099c \u09ac\u09cd\u09af\u09be\u09ac\u09b9\u09be\u09b0 \u0995\u09b0\u09c1\u09a8\u0983","author":"Author-Check- Article-or-Video","date":"March 28, 2015","format":false,"excerpt":"PHP \u09a4\u09c7 \u0987\u09ae\u09c7\u0987\u09b2\u09bf\u0982 : PHPMailer \u09aa\u09cd\u09af\u09be\u0995\u09c7\u099c \u09ac\u09cd\u09af\u09be\u09ac\u09b9\u09be\u09b0 \u0995\u09b0\u09c1\u09a8\u0983 M A Razzak PHP \u09a4\u09c7 \u0987\u09ae\u09c7\u0987\u09b2\u09bf\u0982 : PHPMailer \u09aa\u09cd\u09af\u09be\u0995\u09c7\u099c \u09ac\u09cd\u09af\u09be\u09ac\u09b9\u09be\u09b0 \u0995\u09b0\u09c1\u09a8\u0983 \u2022 \u09a8\u09bf\u099a\u09c7\u09b0 \u09b2\u09bf\u0999\u09cd\u0995 \u09a5\u09c7\u0995\u09c7 PHPMailer \u09aa\u09cd\u09af\u09be\u0995\u09c7\u099c \u09a1\u09be\u0989\u09a8\u09b2\u09cb\u09a1 \u0995\u09b0\u09c1\u09a8\u0983 http:\/\/sourceforge.net\/project\/showfiles.php?group_id=26031 \u2022 \u0986\u09a8\u099c\u09bf\u09aa \u0995\u09b0\u09c7 \u0987\u09a8\u09b8\u09cd\u099f\u09b2 \u0995\u09b0\u09c1\u09a8\u0964 \u2022 \u0995\u09cd\u09b2\u09be\u09b8 \u098f \"class.smtp.php\" \u09af\u09be \u098f\u0995\u099f\u09bf \u09aa\u09cd\u09b0\u09c7\u09b0\u09a3 \u09aa\u09a6\u09cd\u09a7\u09a4\u09bf, \u0987\u09ae\u09c7\u0987\u09b2 \u09aa\u09be\u09a0\u09be\u09a8\u09cb\u09b0 \u099c\u09a8\u09cd\u09af \u098f\u099f\u09bf \u09ac\u09cd\u09af\u09ac\u09b9\u09be\u09b0 \u0995\u09b0\u09be \u09af\u09c7\u09a4\u09c7 \u09aa\u09be\u09b0\u09c7\u0964 \u2022\u2026","rel":"","context":"In &quot;\u09aa\u09bf \u098f\u0987\u099a \u09aa\u09bf\/PHP&quot;","block_context":{"text":"\u09aa\u09bf \u098f\u0987\u099a \u09aa\u09bf\/PHP","link":"http:\/\/bangla.sitestree.com\/?cat=261"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":16206,"url":"http:\/\/bangla.sitestree.com\/?p=16206","url_meta":{"origin":70055,"position":1},"title":"OOP concepts in PHP 5 in brief","author":"Sayed","date":"September 21, 2019","format":false,"excerpt":"OOP concepts in PHP 5 in brief OOP concepts in PHP 5 in brief OOP concepts in PHP 5 in short Why this short\u200a\u2014\u200anote? if you are familiar with OOD and any OOP language such as Java\/C++, this short note will give you enough information to start with PHP 5\u2026","rel":"","context":"In &quot;\u09ac\u09cd\u09b2\u0997 \u0964 Blog&quot;","block_context":{"text":"\u09ac\u09cd\u09b2\u0997 \u0964 Blog","link":"http:\/\/bangla.sitestree.com\/?cat=182"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":67718,"url":"http:\/\/bangla.sitestree.com\/?p=67718","url_meta":{"origin":70055,"position":2},"title":"Code: Send Emails using ASP #Classic ASP","author":"Author-Check- Article-or-Video","date":"July 27, 2021","format":false,"excerpt":"<% dim email email = Request.Form(\"email\") 'if you are collecting user emails from a form - POST method 'send email Dim myObject Set myObject = Server.CreateObject(\"CDO.Message\") 'set the To and From myObject.To = \"webmaster@justetc.net\" myObject.From = \"webmaster@justetc.net\" myObject.Bcc = \"sayed@justetc.net\" myObject.Subject = \"Email Sending Code\" myObject.TextBody = \"The person with\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":70025,"url":"http:\/\/bangla.sitestree.com\/?p=70025","url_meta":{"origin":70055,"position":3},"title":"OOP concepts in PHP 5 in brief #16","author":"Author-Check- Article-or-Video","date":"August 23, 2021","format":false,"excerpt":"OOP concepts in PHP 5 in short Why this short - note? if you are familiar with OOD and any OOP language such as Java\/C++, this short note will give you enough information to start with PHP 5 OOP Class Class definition starts with the keyword class, followed by a\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":10189,"url":"http:\/\/bangla.sitestree.com\/?p=10189","url_meta":{"origin":70055,"position":4},"title":"AddressVerifier.java Connects to an SMTP server and issues a expn request to display details about a mailbox on the server. Uses the following classes","author":"","date":"August 24, 2015","format":false,"excerpt":"import java.net.*; import java.io.*; \/** Given an e-mail address of the form user@host, \u00a0*\u00a0 connect to port 25 of the host and issue an \u00a0*\u00a0 'expn' request for the user. Print the results. \u00a0* \u00a0*\u00a0 Taken from Core Web Programming from \u00a0*\u00a0 Prentice Hall and Sun Microsystems Press, \u00a0*\u00a0 .\u2026","rel":"","context":"In &quot;Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8&quot;","block_context":{"text":"Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8","link":"http:\/\/bangla.sitestree.com\/?cat=1417"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":24404,"url":"http:\/\/bangla.sitestree.com\/?p=24404","url_meta":{"origin":70055,"position":5},"title":"Ajax: An Overview #Root","author":"Author-Check- Article-or-Video","date":"April 8, 2021","format":false,"excerpt":"Ajax: dynamically changes a portion of the current web-page without refreshing t he total web-page. Resembles the way IFrame works. So far I know, google uses IFrame to display\/refresh maps in web-pages XMLHttpRequest is the object that serves the purpose of Ajax The way it works: create an instance of\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/70055","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=70055"}],"version-history":[{"count":0,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/70055\/revisions"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=70055"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=70055"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=70055"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}