{"id":291,"date":"2013-06-13T20:48:00","date_gmt":"2013-06-13T20:48:00","guid":{"rendered":"http:\/\/34@jodohost.com\/\/blog\/"},"modified":"2013-06-13T20:48:00","modified_gmt":"2013-06-13T20:48:00","slug":"sample-phpmailer-script","status":"publish","type":"post","link":"http:\/\/www.jodohost.com\/blog\/index.php\/2013\/06\/13\/sample-phpmailer-script\/","title":{"rendered":"Sample PHPMailer Script"},"content":{"rendered":"<p>To enable SMTP AUTH in PHPMailer:<\/p>\n<p>First download the PHPMailer class file from the site http:\/\/phpmailer.sourceforge.net.<\/p>\n<p>Save it as a php-file in the same directory as your script.<\/p>\n<p>Include this script in your code:<\/p>\n<p><?php<br \/>require(&#8220;class.phpmailer.php&#8221;);<br \/>$mail = new PHPMailer();<br \/>$mail = new PHPMailer(); \/\/Create PHPmailer class<br \/>$mail->From = &#8220;info@domain.com&#8221;; \/\/Sender address<br \/>$mail->FromName = &#8220;BUZZINESS WORLD &#8220;; \/\/The name that you&#8217;ll see as Sender<br \/>$mail->Host = &#8220;mail.domain.com&#8221;; \/\/Your SMTP mail server<br \/>$mail->Port = &#8216;587&#8217;;<br \/>$mail->Mailer = &#8220;smtp&#8221;; \/\/Protocol to use<br \/>$mail->AddAddress(&#8220;info@domain.com&#8221;); \/\/The address you are sending mail to<br \/>$mail->Subject = &#8220;Mail Subject&#8221;; \/\/Subject of the mail<br \/>$mail->Body = &#8220;Write your mail here&#8221;; \/\/Body of the message<br \/>$mail->SMTPAuth = &#8220;true&#8221;;<br \/>$mail->Username = &#8220;info@domain.com&#8221;; \/\/valid email id of the domain<br \/>$mail->Password = &#8220;password&#8221;; \/\/password for abc@xyz<br \/>if(!$mail->Send()){ \/\/Check for result of sending mail<br \/>echo &#8220;There was an error sending the message&#8221;; \/\/Write an error message if mail isn&#8217;t sent&#8221;<br \/>exit; \/\/Exit the script without executing the rest of the code<br \/>}<br \/>echo &#8220;Your query has been sent&#8221;;<br \/>?><\/p>\n<p> ]]><\/p>\n","protected":false},"excerpt":{"rendered":"<p>To enable SMTP AUTH in PHPMailer: First download the PHPMailer class file from the site http:\/\/phpmailer.sourceforge.net. Save it as a php-file in the same directory as your script. Include this script in your code: ]]&gt;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"http:\/\/www.jodohost.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/291"}],"collection":[{"href":"http:\/\/www.jodohost.com\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.jodohost.com\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.jodohost.com\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.jodohost.com\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=291"}],"version-history":[{"count":0,"href":"http:\/\/www.jodohost.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/291\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.jodohost.com\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=291"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.jodohost.com\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=291"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.jodohost.com\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=291"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}