<?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>Web Development Blog &#187; google applications</title>
	<atom:link href="http://www.web-development-blog.com/archives/tag/google-applications/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.web-development-blog.com</link>
	<description>Web development tutorials, SEO articles and PHP script resources</description>
	<lastBuildDate>Sun, 25 Jul 2010 14:38:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Sending e-mails via SMTP with PHPmailer and Gmail</title>
		<link>http://www.web-development-blog.com/archives/send-e-mail-messages-via-smtp-with-phpmailer-and-gmail/</link>
		<comments>http://www.web-development-blog.com/archives/send-e-mail-messages-via-smtp-with-phpmailer-and-gmail/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 19:40:25 +0000</pubDate>
		<dc:creator>Olaf</dc:creator>
				<category><![CDATA[Google services]]></category>
		<category><![CDATA[PHP scripts]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[google applications]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[mail server]]></category>
		<category><![CDATA[smtp]]></category>

		<guid isPermaLink="false">http://www.web-development-blog.com/?p=393</guid>
		<description><![CDATA[Using the SMTP server from Gmail is a good choice for mail application with less than 500 recipients a day. This tutorials shows you how to send mail messages via SMTP using PHPmailer and Gmail.]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><!--S-ButtonZ 1.1.5 End--><p>These days I tried some plugin to send e-mail message within bbpress via SMTP. Since my domains email is hosted with Google applications I decided to send my messages via the SMTP server from GMail. I found several articles and tutorials, but a lot of them didn&#8217;t worked for me. </p>
<h3>Why using GMail for sending mail messages?</h3>
<p>First of all it&#8217;s FREE! Sure most website owners can use their own SMTP server for sending email messages from their website, but it makes sense even than to use Gmail for sending mail. The chance is big that your websites IP address is on a blacklist if your site is on hosted by a shared web hosting provider. If not or you host your site on your own server, there is always a risk that your IP address get blacklisted. Because of some limitations, the SMTP server from Google is a good choice applications with less than 500 recipients a day, check this <a href="http://mail.google.com/support/bin/answer.py?hl=en&#038;answer=22839" rel="nofollow">information</a> from the Google help pages.<span id="more-393"></span></p>
<h3>Requirements</h3>
<p>You need for this code example a PHP5 enabled web host (I tested only on Linux), the port 465 need to be open and of course you need a GMail or Google Apps account. </p>
<h3>SMTP for Gmail tutorial</h3>
<ol>
<li>If you don&#8217;t have one, <a href="http://mail.google.com/mail/signup" rel="nofollow">register</a> a GMail account or setup your domain for Google applications.</li>
<li><a href="http://sourceforge.net/projects/phpmailer/files/phpmailer%20for%20php5_6/" rel="nofollow">Download</a> a recent version of PHPMailer (I used the version 5.02)</li>
<li>Check with your web hosting provider if port 465 (TCP out) is open, if not ask him to open that port</li>
<li>Include the PHPMailer class file: <code>require_once('phpmailer/class.phpmailer.php');</code></li>
<li>Create those two constant variable to store your GMail login and password. Use the login for your Google application mail if you have one.

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'GUSER'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'you@gmail.com'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Gmail username</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'GPWD'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'password'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Gmail password</span></pre></div></div>

<li>Use the following function to send mail messages (add the function in one of your included files):

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> smtpmailer<span style="color: #009900;">&#40;</span><span style="color: #000088;">$to</span><span style="color: #339933;">,</span> <span style="color: #000088;">$from</span><span style="color: #339933;">,</span> <span style="color: #000088;">$from_name</span><span style="color: #339933;">,</span> <span style="color: #000088;">$subject</span><span style="color: #339933;">,</span> <span style="color: #000088;">$body</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
	<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$error</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$mail</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> PHPMailer<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">// create a new object</span>
	<span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">IsSMTP</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// enable SMTP</span>
	<span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">SMTPDebug</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">// debugging: 1 = errors and messages, 2 = messages only</span>
	<span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">SMTPAuth</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">// authentication enabled</span>
	<span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">SMTPSecure</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'ssl'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// secure transfer enabled REQUIRED for Gmail</span>
	<span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Host</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'smtp.gmail.com'</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Port</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">465</span><span style="color: #339933;">;</span> 
	<span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Username</span> <span style="color: #339933;">=</span> GUSER<span style="color: #339933;">;</span>  
	<span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Password</span> <span style="color: #339933;">=</span> GPWD<span style="color: #339933;">;</span>           
	<span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">SetFrom</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$from</span><span style="color: #339933;">,</span> <span style="color: #000088;">$from_name</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Subject</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$subject</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Body</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$body</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">AddAddress</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$to</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Send</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$error</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Mail error: '</span><span style="color: #339933;">.</span><span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ErrorInfo</span><span style="color: #339933;">;</span> 
		<span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$error</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Message sent!'</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Most of the setting inside the function are required by GMail. While searching for tutorials I found articles with different settings for the port and security. My advice use them as in this tutorial.
</li>
<li>Call the function within your code:

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">smtpmailer<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'to@mail.com'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'from@mail.com'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'yourName'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'test mail message'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Hello World!'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Use this more &#8220;advanced&#8221; usage inside your application:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>smtpmailer<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'to@mail.com'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'from@mail.com'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'yourName'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'test mail message'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Hello World!'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #666666; font-style: italic;">// do something</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$error</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$error</span><span style="color: #339933;">;</span></pre></div></div>

</li>
</ol>
<h3>Advanced setup with fall-back SMTP server</h3>
<p>Because of the limit it might be useful to use a secondary SMTP server if the Gmail option didn&#8217;t send the message. For this functionality we need to replace the part with the SMTP settings a little bit. First create login/server variables for the 2nd SMTP server:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'SMTPUSER'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'you@yoursmtp.com'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// sec. smtp username</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'SMTPPWD'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'password'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// sec. password</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'SMTPSERVER'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'smtp.yoursmtp.com'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// sec. smtp server</span></pre></div></div>

<p>Next we need to create a if/else statement using the variables for the second server (replace).</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> smtpmailer<span style="color: #009900;">&#40;</span><span style="color: #000088;">$to</span><span style="color: #339933;">,</span> <span style="color: #000088;">$from</span><span style="color: #339933;">,</span> <span style="color: #000088;">$from_name</span><span style="color: #339933;">,</span> <span style="color: #000088;">$subject</span><span style="color: #339933;">,</span> <span style="color: #000088;">$body</span><span style="color: #339933;">,</span> <span style="color: #000088;">$is_gmail</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
	<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$error</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$mail</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> PHPMailer<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">IsSMTP</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">SMTPAuth</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span> 
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$is_gmail</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">SMTPSecure</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'ssl'</span><span style="color: #339933;">;</span> 
		<span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Host</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'smtp.gmail.com'</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Port</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">465</span><span style="color: #339933;">;</span>  
		<span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Username</span> <span style="color: #339933;">=</span> GUSER<span style="color: #339933;">;</span>  
		<span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Password</span> <span style="color: #339933;">=</span> GPWD<span style="color: #339933;">;</span>   
	<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Host</span> <span style="color: #339933;">=</span> SMTPSERVER<span style="color: #339933;">;</span>
		<span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Username</span> <span style="color: #339933;">=</span> SMTPUSER<span style="color: #339933;">;</span>  
		<span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Password</span> <span style="color: #339933;">=</span> SMTPPWD<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>        
	<span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">SetFrom</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$from</span><span style="color: #339933;">,</span> <span style="color: #000088;">$from_name</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Subject</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$subject</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Body</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$body</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">AddAddress</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$to</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Send</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$error</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Mail error: '</span><span style="color: #339933;">.</span><span style="color: #000088;">$mail</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ErrorInfo</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$error</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Message sent!'</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>And use the function now as followed:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$msg</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Hello World'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$subj</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'test mail message'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$to</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'to@mail.com'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$from</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'from@mail.com'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$name</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'yourName'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>smtpmailer<span style="color: #009900;">&#40;</span><span style="color: #000088;">$to</span><span style="color: #339933;">,</span> <span style="color: #000088;">$from</span><span style="color: #339933;">,</span> <span style="color: #000088;">$name</span><span style="color: #339933;">,</span> <span style="color: #000088;">$subj</span><span style="color: #339933;">,</span> <span style="color: #000088;">$msg</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Yippie, message send via Gmail'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>smtpmailer<span style="color: #009900;">&#40;</span><span style="color: #000088;">$to</span><span style="color: #339933;">,</span> <span style="color: #000088;">$from</span><span style="color: #339933;">,</span> <span style="color: #000088;">$name</span><span style="color: #339933;">,</span> <span style="color: #000088;">$subj</span><span style="color: #339933;">,</span> <span style="color: #000088;">$msg</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$error</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$error</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Yep, the message is send (after hard working)'</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p><a href="http://www.freelancer.com/affiliates/olederer/" rel="nofollow"><img src="http://www.freelancer.com/img/affiliates/Freelancer_b2.gif" width=468 height=60 alt="Freelance Jobs" border=0></a></p>
<p>Both examples are very simple and demonstrate only how-to send mail messages via the SMTP server from Gmail. Of course the user can extend the code to handle HTML messages and attachments etc. If you have any issues with these examples, just let me know. Post a comment here or post to our partner <a href="http://www.finalwebsites.com/forums">PHP script forum</a>.</p>
<p><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://www.web-development-blog.com/archives/php-mail-scripts-using-smtp-transport-a-guide-for-beginners/" rel="bookmark" title="April 12, 2010">PHP Mail Scripts using SMTP transport, a guide for beginners</a></li>
<li><a href="http://www.web-development-blog.com/archives/create-custom-backups-from-your-website-using-curl/" rel="bookmark" title="July 30, 2008">Create custom backups from your website using cURL</a></li>
<li><a href="http://www.web-development-blog.com/archives/jquery-contact-form-for-your-website/" rel="bookmark" title="January 11, 2010">jQuery Contact form for your website</a></li>
</ul>
<p><!-- Similar Posts took 4.992 ms --></p>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://www.web-development-blog.com/archives/send-e-mail-messages-via-smtp-with-phpmailer-and-gmail/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->