<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Vishal Kumar &#187; Tutorial</title>
	<atom:link href="http://www.vishalkumar.in/category/tutorial/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.vishalkumar.in</link>
	<description>Think Different. Make a Difference.</description>
	<lastBuildDate>Thu, 24 Nov 2011 15:54:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>How to set up Trac and Subversion SVN on Dreamhost</title>
		<link>http://www.vishalkumar.in/2009/09/how-to-set-up-trac-and-subversion-svn-on-dreamhost/</link>
		<comments>http://www.vishalkumar.in/2009/09/how-to-set-up-trac-and-subversion-svn-on-dreamhost/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 17:51:23 +0000</pubDate>
		<dc:creator>Vishal</dc:creator>
				<category><![CDATA[Screenshots]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.vishalkumar.in/?p=249</guid>
		<description><![CDATA[While I was just digging around Dreamhost&#8217;s panel, I stumbled across a new One Click Install I had not seen before: Trac. Trac is, according to their site,  an enhanced wiki and issue tracking system for software development projects. Nifty. The last time I had tried my hand with Trac, I think I almost lost [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_260" class="wp-caption alignleft" style="width: 246px"><a href="http://www.vishalkumar.in/wp-content/uploads/2009/09/trac.png"><img class="size-full wp-image-260" title="Trac" src="http://www.vishalkumar.in/wp-content/uploads/2009/09/trac.png" alt="Trac" width="236" height="73" /></a><p class="wp-caption-text">Trac</p></div>
<p>While I was just digging around Dreamhost&#8217;s panel, I stumbled across a new One Click Install I had not seen before: <a title="Trac Homepage" href="http://trac.edgewall.org/">Trac</a>.</p>
<p>Trac is, according to their <a title="Trac Site" href="http://trac.edgewall.org/">site</a>,  <em>an enhanced wiki and issue tracking system for software development projects</em>. Nifty. The last time I had tried my hand with Trac, I think I almost lost my hands. But now, Dreamhost has made it super easy to get Trac, and <a title="Subversion" href="http://subversion.tigris.org/">Subversion </a>(a Concurrent Version System, made super easy with <a title="Go to the Tortoise SVN site" href="http://tortoisesvn.tigris.org/">TortoiseSVN</a>) along with it.</p>
<p>Now, as excited as I was to get this &#8216;new&#8217; thing running on my account, I realized I knew precious little about how to set it up beyond the One Click of  the famed One Click Installation process. True, Trac was now <em>installed </em>in my account, but what next?</p>
<p>A long story short, I figured someone else might walk down the same path (and get lost like I did). So I basically screenshotted the path of least resistance to setting up Trac and Subversion on Dreamhost.</p>
<p><span id="more-249"></span>This procedure, assumes of course, that you have a Dreamhost account. If you don&#8217;t, then, well, you could enjoy <a title="Chat Noir in Javascript" href="http://www.vishalkumar.in/works/jscat">this game</a> I wrote in javascript, before you move on.</p>
<p><strong>Step 1: Set up Subversion</strong></p>
<p>After you&#8217;ve logged into <a title="Dreamhost Panel" href="http://panel.dreamhost.com">Dreamhost&#8217;s Panel</a>, go to Subversion under Goodies. And fill out the form. The steps are fairly logical. You&#8217;ll get a delightful email from the Subversion creation Robot.</p>
<div id="attachment_250" class="wp-caption aligncenter" style="width: 779px"><a href="http://www.vishalkumar.in/wp-content/uploads/2009/09/trac1subversion.png"><img class="size-full wp-image-250 " title="Setting up Subversion" src="http://www.vishalkumar.in/wp-content/uploads/2009/09/trac1subversion.png" alt="Setting up Subversion" width="769" height="458" /></a><p class="wp-caption-text">Setting up Subversion</p></div>
<p><strong>Step 2: Installing Trac</strong></p>
<p>Make use of the One-Click Install feature in Dreamhost Panel, and go to second set of options to Advance Install. Select Trac, and type in an install directory. Make sure that this is empty. Select the SVN repository that you created above. Click install. You&#8217;ll (hopefully) get another delightful email.</p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<div id="attachment_251" class="wp-caption aligncenter" style="width: 812px"><a href="http://www.vishalkumar.in/wp-content/uploads/2009/09/trac2install.png"><img class="size-full wp-image-251 " title="One Click Install Trac" src="http://www.vishalkumar.in/wp-content/uploads/2009/09/trac2install.png" alt="Install Trac in One Click" width="802" height="446" /></a><p class="wp-caption-text">Install Trac in One Click</p></div>
<p><strong>Step 3:</strong></p>
<p><span style="font-weight: normal;">After step 2, you should have a Trac and Subversion SVN up and running at their respective addresses. However, you still have to create an Admin user to get things rolling. (Unless having a fixed default installation is what you had in mind all along)</span></p>
<p>In Trac, the user authentication is tied into something called <em>htaccess</em>. This is something directly involved with Apache, the web server, and its settings can be access from the Goodies&gt;Htaccess/WebDAV menu option.</p>
<p>Clicking on it will lead you to a list of the domains you have. Click on the one that you have installed Trac to. Then click on create a new directory.</p>
<p>Type in the same directory name as the Trac installation. And check the Password-protect this dir option. In the text area, type in some username &#8211; password combinations according the format given. You should have something like this:</p>
<div id="attachment_256" class="wp-caption aligncenter" style="width: 812px"><a href="http://www.vishalkumar.in/wp-content/uploads/2009/09/trac3htaccess.png"><img class="size-full wp-image-256 " title="Htaccess in Dreamhost" src="http://www.vishalkumar.in/wp-content/uploads/2009/09/trac3htaccess.png" alt="Set up Htaccess in Dreamhost Panel" width="802" height="446" /></a><p class="wp-caption-text">Set up Htaccess in Dreamhost Panel</p></div>
<p><strong>Step 4:Getting Shell Access</strong></p>
<p>Now, if you are like me, and haven&#8217;t used Dreamhost anything beyond FTP and some of the nifty features of the Panel, then welcome to the Shell Access for your host server. Basically, you&#8217;ll need to login into the server and run the &#8216;trac-admin&#8217; program on the server and tell it to give you the Administrator rights, so that you can do those tasks through the web interface itself.</p>
<p><span style="font-weight: normal;">So, get yourself shell access by going into Manage Users on the toolbox, and then selecting a Shell Account (so that you can still ftp with that account).</span></p>
<p><span style="font-weight: normal;"> </span></p>
<div id="attachment_254" class="wp-caption aligncenter" style="width: 774px"><a href="http://www.vishalkumar.in/wp-content/uploads/2009/09/trac3access1.png"><img class="size-full wp-image-254 " title="Shell Access for User" src="http://www.vishalkumar.in/wp-content/uploads/2009/09/trac3access1.png" alt="Grant Shell Access to User" width="764" height="454" /></a><p class="wp-caption-text">Grant Shell Access to User</p></div>
<p><strong>Step 5: Login with PuTTY</strong></p>
<p>Now you&#8217;ll actually need to log in into the server. For this you need a program that can SSH, like <a title="Download PuTTY here" href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html">PuTTY</a>. <a title="Download PuTTY here" href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html">Get it here</a>.</p>
<div id="attachment_255" class="wp-caption aligncenter" style="width: 466px"><a href="http://www.vishalkumar.in/wp-content/uploads/2009/09/trac4puttyc.png"><img class="size-full wp-image-255" title="PuTTY Configuration" src="http://www.vishalkumar.in/wp-content/uploads/2009/09/trac4puttyc.png" alt="PuTTY Configuration" width="456" height="436" /></a><p class="wp-caption-text">PuTTY Configuration</p></div>
<p>Upon pressing Open, you should be connected to the host, and you&#8217;ll get a username/password request. This are the same details for the account you just changed the type to Shell for.</p>
<p><strong>Step 5: Giving Administrator Rights</strong></p>
<p>Now, you&#8217;ll need to give yourself administrator rights. The way this is done is by calling on the &#8216;trac-admin&#8217; program to give so-and-so user the &#8216;TRAC_ADMIN&#8217; permission right. Once you have that, you needn&#8217;t return to this dark place, and can use the web interface for most of the work that you require. Right, go ahead, type something like the following then:</p>
<pre>trac-admin www.vishalkumar.in/tracme permission add vishal TRAC_ADMIN</pre>
<p>Replace the <em>www.vishalkumar.in/tracme</em> with the exact address you asked the One Click Installer to install Trac into. Replace <em>vishal </em>with your username.</p>
<div id="attachment_257" class="wp-caption aligncenter" style="width: 685px"><a href="http://www.vishalkumar.in/wp-content/uploads/2009/09/trac5admin.png"><img class="size-full wp-image-257" title="Giving yourself Administrator Rights" src="http://www.vishalkumar.in/wp-content/uploads/2009/09/trac5admin.png" alt="Giving yourself Administrator Rights" width="675" height="422" /></a><p class="wp-caption-text">Giving yourself Administrator Rights</p></div>
<p>Running  the permission list command will show the current list of permissions.</p>
<p><strong>Step 6: You&#8217;re Done!</strong></p>
<p>Well, if you&#8217;ve reached this far, then you&#8217;ve managed to successfully installed Trac and Subversion, and created an Administrator for it, on Dreamhost. If you browse to your Trac site, you&#8217;ll be requested for a username and password (the one you just created in htaccess). You should see something like</p>
<div id="attachment_258" class="wp-caption aligncenter" style="width: 727px"><a href="http://www.vishalkumar.in/wp-content/uploads/2009/09/trac6web.png"><img class="size-large wp-image-258 " title="Trac Web Interface" src="http://www.vishalkumar.in/wp-content/uploads/2009/09/trac6web-1024x535.png" alt="Trac Web Interface" width="717" height="375" /></a><p class="wp-caption-text">Trac Web Interface</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.vishalkumar.in/2009/09/how-to-set-up-trac-and-subversion-svn-on-dreamhost/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Help: I Can&#8217;t Open .EXE Files!</title>
		<link>http://www.vishalkumar.in/2009/08/help-i-cant-open-exe-files/</link>
		<comments>http://www.vishalkumar.in/2009/08/help-i-cant-open-exe-files/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 18:11:23 +0000</pubDate>
		<dc:creator>Vishal</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.vishalkumar.in/?p=222</guid>
		<description><![CDATA[Actually, this is the exact query that I got: In my system all exe files are being opened with notepad!!! Thats more or less what I got in a conversation a few minutes ago. Now, this particular question isn&#8217;t particularly new, and it can be caused by an overzealous tinkerer or a malicious code (if [...]]]></description>
			<content:encoded><![CDATA[<p>Actually, this is the exact query that I got:</p>
<blockquote><p>In my system all exe files are being opened with notepad!!!</p></blockquote>
<p>Thats more <span style="text-decoration: line-through;">or less</span> what I got in a conversation a few minutes ago. Now, this particular question isn&#8217;t particularly new, and it can be caused by an overzealous tinkerer or a malicious code (if you haven&#8217;t done anything, truthfully, and this happened to you, please check it out with an antivirus).</p>
<p>The problem, if you want to understand is that Windows is designed so that every file is expected to have an extension. That 3 letter ending tells the Windows OS with which program to open the file with. So if you have .txt file, you should open it with Notepad.exe.</p>
<p>Now what about a .exe file? Who opens that? The answer is simple: Itself! Hence you have to tell the OS (through the Registry Editor), to open the .exe file with itself. Hence <strong>&#8220;%1&#8243; %*</strong> as the open with command, which indicates that the file needs to be opened with the same .exe (%1), and having the same arguments (%*) that it was assigned.</p>
<p>Anyway, in order to fix this, please follow the following instructions..</p>
<p><span id="more-222"></span></p>
<ul>
<li>Open up Regedit</li>
</ul>
<div id="attachment_223" class="wp-caption aligncenter" style="width: 357px"><a href="http://www.vishalkumar.in/wp-content/uploads/2009/08/Screenshot-8_19_2009-10_31_36-PM.png"><img class="size-full wp-image-223" title="Run Regedit" src="http://www.vishalkumar.in/wp-content/uploads/2009/08/Screenshot-8_19_2009-10_31_36-PM.png" alt="Run Regedit" width="347" height="186" /></a><p class="wp-caption-text">Run Regedit</p></div>
<ul>
<li>Go to HKEY_CLASSES_ROOT</li>
</ul>
<div id="attachment_225" class="wp-caption aligncenter" style="width: 558px"><a href="http://www.vishalkumar.in/wp-content/uploads/2009/08/Screenshot-8_19_2009-10_58_08-PM.png"><img class="size-full wp-image-225" title="Go into HKEY_CLASSES_ROOT" src="http://www.vishalkumar.in/wp-content/uploads/2009/08/Screenshot-8_19_2009-10_58_08-PM.png" alt="Go into HKEY_CLASSES_ROOT" width="548" height="362" /></a><p class="wp-caption-text">Go into HKEY_CLASSES_ROOT</p></div>
<ul>
<li>Go into HKEY_CLASSES_ROOT\exefile\shell\open\command</li>
</ul>
<div id="attachment_226" class="wp-caption aligncenter" style="width: 558px"><a href="http://www.vishalkumar.in/wp-content/uploads/2009/08/Screenshot-8_19_2009-10_33_12-PM.png"><img class="size-full wp-image-226" title="Go into HKEY_CLASSES_ROOT\exefile\shell\open\command" src="http://www.vishalkumar.in/wp-content/uploads/2009/08/Screenshot-8_19_2009-10_33_12-PM.png" alt="Go into HKEY_CLASSES_ROOT\exefile\shell\open\command" width="548" height="362" /></a><p class="wp-caption-text">Go into HKEY_CLASSES_ROOT\exefile\shell\open\command</p></div>
<ul>
<li>Now, there should be only one String entry. Double click on that, and type in &#8220;%1&#8243; %*</li>
</ul>
<div id="attachment_227" class="wp-caption aligncenter" style="width: 394px"><a href="http://www.vishalkumar.in/wp-content/uploads/2009/08/Screenshot-8_19_2009-10_33_19-PM.png"><img class="size-full wp-image-227 " title="Edit string and put &quot;%1&quot; %*" src="http://www.vishalkumar.in/wp-content/uploads/2009/08/Screenshot-8_19_2009-10_33_19-PM.png" alt="Edit string and put _&quot;%1&quot; %*_" width="384" height="169" /></a><p class="wp-caption-text">Edit string and put &quot;%1&quot; %*</p></div>
<p>Anyways, hope that helped out. Comment if you need some more digging out <img src='http://www.vishalkumar.in/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-3193002116048421";
/* 468x15, created 6/20/09 */
google_ad_slot = "3058647263";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.vishalkumar.in/2009/08/help-i-cant-open-exe-files/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Asp.NET Mail using Gmail SMTP Tutorial</title>
		<link>http://www.vishalkumar.in/2009/06/aspnet-mail-using-gmail-smtp-tutorial/</link>
		<comments>http://www.vishalkumar.in/2009/06/aspnet-mail-using-gmail-smtp-tutorial/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 20:17:22 +0000</pubDate>
		<dc:creator>Vishal</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[asp]]></category>
		<category><![CDATA[gmail]]></category>

		<guid isPermaLink="false">http://www.vishalkumar.in/?p=157</guid>
		<description><![CDATA[A tutorial on sending Asp.NET email using GMail's SMTP.]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s very useful to learn how to set up to send mail using Asp.NET, both GMail and Asp.NET are widely used and trusted. One advantage is flexibility: If you&#8217;re a setting up a large email system for mass mail-outs to <a href="http://www.foxybingo.com/" target="_blank">Foxy Bingo</a> customers and other gaming fans, or if you&#8217;re a smaller, family business who is just mailing your local clientele, this system is up to the job. Enjoy the tutorial.</p>
<p>So here is another, even briefer, tutorial on sending mail in Asp.NET using GMail SMTP (means using a GMail Account doh!).<br />
<span id="more-157"></span></p>
<p>Alright, this is what you do:</p>
<ol>
<li>If you haven&#8217;t done so already, download a .NET development tool like <a href="http://www.microsoft.com/exPress/download/#webInstall">Visual Web Developer 2008 Express Edition</a>.</li>
<li>Go to File&gt;New Web Site, select new ASP.NET Web Site, and choose Visual C# for your language. (Ok, You&#8217;ve mostly probably already come up to this stage, but I&#8217;m just being complete. <img src='http://www.vishalkumar.in/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ol>
<div id="attachment_158" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.vishalkumar.in/wp-content/uploads/2009/06/screenshot-6_10_2009-11_49_11-pm.png"><img class="size-medium wp-image-158" title="Screenshot of New Web Site" src="http://www.vishalkumar.in/wp-content/uploads/2009/06/screenshot-6_10_2009-11_49_11-pm-300x193.png" alt="Step 2 in action. If you are not seeing this, try harder." width="300" height="193" /></a><p class="wp-caption-text">Step 2 in action. If you are not seeing this, try harder.</p></div>
<ol>
<li>Now, by default you&#8217;ll see your Default.aspx file, where you can use the visual tools to drag and drop in your files. But you actually want the Default.aspx.cs file to edit. On the right you&#8217;ll see your Solution Explorer. Click on the plus and double click on Default.aspx.cs</li>
</ol>
<div id="attachment_159" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.vishalkumar.in/wp-content/uploads/2009/06/screenshot-6_10_2009-11_54_01-pm.png"><img class="size-medium wp-image-159" title="Screenshot of Visual Web Developer 2008 Express" src="http://www.vishalkumar.in/wp-content/uploads/2009/06/screenshot-6_10_2009-11_54_01-pm-300x187.png" alt="Top right, Solution Explorer. Code in the middle." width="300" height="187" /></a><p class="wp-caption-text">Top right, Solution Explorer. Code in the middle.</p></div>
<ol>
<li>Here you&#8217;ll have the actual C# code that runs to generate your HTML output for the browser. So this is where you shall put in your C# Mail code. Be sure to edit out like the username (your entire GMail gmail), and password (you know, that one).</li>
</ol>
<pre>using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Net.Mail;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        sendMail();
    }
    public void sendMail()
    {
        string from="vishalkumar@gmail.com";
        string to = "vishalkumar@gmail.com";
        string subject = "Hi there";
        string body = "Hey there &lt;br /&gt; Check out http://www.vishalkumar.in";
        sendMailall(from, to, subject, body);
    }
    public void sendMailall(string from, string to, string subject, string body)
    {
        MailMessage mail = new MailMessage();
        mail.To.Add(to);
        mail.From = new MailAddress(from);
        mail.Subject = subject;
        mail.Body = body;
        mail.IsBodyHtml = true;
        SmtpClient smtp = new SmtpClient();
        smtp.Host = "smtp.gmail.com";
        smtp.Credentials =
             new System.Net.NetworkCredential("vishalkumar@gmail.com",
                                                                "thisisnotmypassword");
        smtp.EnableSsl = true;
        smtp.Send(mail);
     }
}</pre>
<ol>
<li>Now just press F5 to debug, which basically means run the page. By simply running the above page, you&#8217;ll trigger the code to send an email to the address specified.</li>
<li>And you&#8217;re done for now. You can now add extra features like creating a form, or sending automated emails, etc, for all you like. Enjoy.</li>
</ol>
<p>And thats it. Alright I admit, you didn&#8217;t really need that many steps. Frankly, just copy the code and play with it.</p>
<p>If you get stuck (and you tried really really hard yes please), gmail me later. Or comment up.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.vishalkumar.in/2009/06/aspnet-mail-using-gmail-smtp-tutorial/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>PHP Mail using Gmail SMTP Tutorial</title>
		<link>http://www.vishalkumar.in/2009/06/php-mail-using-gmail-smtp-tutorial/</link>
		<comments>http://www.vishalkumar.in/2009/06/php-mail-using-gmail-smtp-tutorial/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 13:17:08 +0000</pubDate>
		<dc:creator>Vishal</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[gmail]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.vishalkumar.in/?p=135</guid>
		<description><![CDATA[So here is the tutorial for sending PHP Mail using Gmail as your SMTP engine]]></description>
			<content:encoded><![CDATA[<p>Alright, this was one of the queries I got a few days back. I finally got the time to pour some time on it.</p>
<p>So here is the tutorial for sending PHP Mail using Gmail as your SMTP engine.</p>
<p><span id="more-135"></span></p>
<p>First of you all, I&#8217;m going to pretend that you&#8217;re familiar with a few things:</p>
<ul>
<li>PHP (you know, PHP: Hypertext Preprocessor). Its a lovely language for developing webpages. If you already knew that, then good. If not, you might want to read a <a title="W3C Schools PHP Tutorials" href="http://www.w3schools.com/PHP/DEfaULT.asP">good PHP Tutorial</a>.</li>
<li>A local apache+PHP webserver running to test with. I use either <a title="XAMPP Server" href="http://www.apachefriends.org/en/xampp.html">XAMPP</a> or <a title="WAMP Server" href="http://www.wampserver.com/en/">WAMPServer</a>, while on Windows Vista. Or <a title="Forum Post for Installing LAMP via Synaptic" href="http://ubuntuforums.org/archive/index.php/t-510403.html">install LAMP stack in Ubuntu</a>.</li>
<li>Can edit your PHP.ini configuration file. (If you don&#8217;t know what I&#8217;m talking about, get <em>really </em>familiar with the above two.</li>
</ul>
<p>K, here goes.</p>
<ol>
<li>If you haven&#8217;t done so already, get a PHP server running.</li>
<p></p>
<li>Download <a title="PHP Mailer Download" href="http://sourceforge.net/project/showfiles.php?group_id=26031&amp;package_id=252700">PHP-Mailer</a> (they also have other php software for easy form-to-email).</li>
<p></p>
<li>Go to your C:\xampplite\htdocs folder (in XAMPP) or C:\wamp\www folder (in WAMP), and extract the PHP Mailer into it. I&#8217;ll call this folder Root from now on.</li>
<p></p>
<li>Now go to Root\PHP-Mailer\examples\, and open up test_smtp_gmail_basic.php.</li>
<p></p>
<li>Now you shall have to do some minor editing. Don&#8217;t worry, its majorly minor. Just change the Emails to your send and receiver, and type your password. Here&#8217;s what mine almost looks like. Almost. Thats not the password. &#8230; I think.</li>
<p>
</ol>
<p>
<div id="attachment_144" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.vishalkumar.in/wp-content/uploads/2009/06/screenshot-6_10_2009-4_47_08-pm.png"><img class="size-medium wp-image-144" title="screenshot-6_10_2009-4_47_08-pm" src="http://www.vishalkumar.in/wp-content/uploads/2009/06/screenshot-6_10_2009-4_47_08-pm-300x209.png" alt="Open and edit test_smtp_gmail_basic.php" width="300" height="209" /></a><p class="wp-caption-text">Open and edit test_smtp_gmail_basic.php</p></div><br />
</p>
<blockquote><p><code>$mail-&gt;IsSMTP(); // telling the class to use SMTP</code><br />
<br />
<code>$mail-&gt;Host       = "stmp.gmail.com"; // SMTP server</code></p>
<p><code>$mail-&gt;SMTPDebug  = 1;                     // enables SMTP debug information (for testing)</code></p>
<p><code>// 1 = errors and messages</code></p>
<p><code>// 2 = messages only</code></p>
<p><code>$mail-&gt;SMTPAuth   = true;                  // enable SMTP authentication</p>
<p>$mail-&gt;SMTPSecure = "ssl";                 // sets the prefix to the servier</p>
<p>$mail-&gt;Host       = "smtp.gmail.com";      // sets GMAIL as the SMTP server</p>
<p>$mail-&gt;Port       = 465;                   // set the SMTP port for the GMAIL server</p>
<p>$mail-&gt;Username   = "<strong>vishalkumar@gmail.com</strong>";  // GMAIL username</p>
<p>$mail-&gt;Password   = "<strong>topsecretpassword:D</strong>";            // GMAIL password</p>
<p>$mail-&gt;SetFrom('<strong>vishalkumar@gmail.com</strong>', 'Vishal Kumar');</p>
<p>$mail-&gt;AddReplyTo("<strong>vishalkumar@gmail.com</strong>","Vishal Kumar");</p>
<p>$mail-&gt;Subject    = "Hey, check out http://www.vishalkumar.in";</p>
<p>$mail-&gt;AltBody    = "Hey, check out this new post on www.vishalkumar.in"; // optional, comment out and test</p>
<p>$mail-&gt;MsgHTML($body);</p>
<p>$address = "<strong>vishalkumar@gmail.com</strong>";</p>
<p></code><code>$mail-&gt;AddAddress($address, "Vishal Kumar");<br />
</code></p></blockquote>
<p></p>
<ol start="6">
<li>Now, pressing save, you&#8217;ll be half done with this little tutorial. Ok, the actual step is you need to edit your PHP.ini file settings. You can find that C:\xampplite\php if you are into XAMPP. Here you need to open the PHP.ini file, then search for &#8220;openssl&#8221;. Go ahead and take that &#8216;;&#8217; comment symbol from the start of the line. In WAMP, all you need is your mouse. Just click on the speedometer icon of WAMPServer in the taskbar. Go to PHP&gt;PHP Extensions and click on <strong>php_openssl</strong> to turn it on</li>
</ol>
<p><div id="attachment_145" class="wp-caption aligncenter" style="width: 421px"><a href="http://www.vishalkumar.in/wp-content/uploads/2009/06/screenshot-6_10_2009-5_59_21-pm.png"><img class="size-full wp-image-145  " title="screenshotofphpopenssl" src="http://www.vishalkumar.in/wp-content/uploads/2009/06/screenshot-6_10_2009-5_59_21-pm.png" alt="Enable the php_openssl.dll extension by taking off the ';'" width="411" height="293" /></a><p class="wp-caption-text">Enable the php_openssl.dll extension by taking off the &#39;;&#39; in XAMPP</p></div><br />
<br />
<div id="attachment_146" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.vishalkumar.in/wp-content/uploads/2009/06/screenshot-6_10_2009-6_04_00-pm.png"><img class="size-medium wp-image-146" title="wamppphp_openssl" src="http://www.vishalkumar.in/wp-content/uploads/2009/06/screenshot-6_10_2009-6_04_00-pm-300x200.png" alt="Tick to enable php_openssl in WAMP" width="300" height="200" /></a><p class="wp-caption-text">Tick to enable php_openssl in WAMP</p></div><br />
</p>
<ol start="7">
<li>Restart your servers services. This should be fairly simple</li>
<p></p>
<li>Go navigate to http://localhost/PHP-Mailer/examples/test_smtp_gmail_basic.php in your browser. And then check your Receivers Inbox. Hi!!!</li>
</ol>
<p>Thats about it; thats how I managed to send emails using GMail&#8217;s SMTP engine to any mail, through PHP.</p>
<p>Note though, this tutorial is meant to be a specific reply to a certain query I got, but I figured more people would want to read this, so I posted it up.</p>
<p>If you have any doubts, or extensions, or any helpful suggestions, comment up. <img src='http://www.vishalkumar.in/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.vishalkumar.in/2009/06/php-mail-using-gmail-smtp-tutorial/feed/</wfw:commentRss>
		<slash:comments>45</slash:comments>
		</item>
	</channel>
</rss>

