Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > Windows Azure > Using Windows Azure Case Study (Move to VM - Windows) > ขั้นตอนที่ 6 : การติดตั้ง SMTP บน VM Windows Server เพื่อใช้สำหรับส่งอีเมล์ด้วย PHP



Clound SSD Virtual Server

ขั้นตอนที่ 6 : การติดตั้ง SMTP บน VM Windows Server เพื่อใช้สำหรับส่งอีเมล์ด้วย PHP

ขั้นตอนที่ 6 : การติดตั้ง SMTP บน VM Windows Server เพื่อใช้สำหรับส่งอีเมล์ด้วย PHP หากบนเว็บไซต์ของเรามีการส่งอีเมล์ออกไปยังข้างนอกด้วยการใช้ function mail() บน PHP ใน VM ที่เป็น Windows Server ก็สามารถที่จะติดตั้ง SMTP Serer ที่อยู่บน IIS จากนั้นก็เปิดใช้งาน SMTP เพียงเท่านี้ก็จะสามารถส่งอีเมล์ออกไปข้างนอกได้แล้ว โดยขั้นตอนนี้จะต้องทำอยู่ 2 ส่วนคือ ใน VM ของ Windows Server จะทำการติดตั้ง SMTP และบนเปิด Endpoint สำหรับ Port : 25 ที่อยู่บน Portal Management ของ Windows Azure

ภายใต้ VM บน Windows Azure

Windows Azure VM Windows Server SMTP Mail

ทำการ Remote Desktop เพื่อเข้าไปจัดการ VM Windows Server

Windows Azure VM Windows Server SMTP Mail

เปิด Server Manager คลิกขวาที่ Features -> Add Features

Windows Azure VM Windows Server SMTP Mail

เลือก SMTP Server

Windows Azure VM Windows Server SMTP Mail

ทำการ Install

Windows Azure VM Windows Server SMTP Mail

ติดตั้งเรียบร้อย เลือก Close








Windows Azure VM Windows Server SMTP Mail

หลังจากที่ติดตั้ง SMTP เรียบร้อย จะมี IIS Manager ของ Version 6 ซึ่งเอาไว้จัดการกับ SMTP Server

Windows Azure VM Windows Server SMTP Mail

หน้าจอ IIS 6 ซึ่งจะมี SMTP Server อยู่

Windows Azure VM Windows Server SMTP Mail

คลิกขวาที่ SMTP -> Properties

Windows Azure VM Windows Server SMTP Mail

ภายใต้ Tab ของ Access คลิก Connection

Windows Azure VM Windows Server SMTP Mail

เลือก All except the list below

Windows Azure VM Windows Server SMTP Mail

และ Reply

Windows Azure VM Windows Server SMTP Mail

เลือก All except the list below

Windows Azure VM Windows Server SMTP Mail

จากนั้นให้กลับมาที่ IIS6 หน้าจอสำหรับจัดการกับ SMTP ให้ทำการ Stop และ Start ใหม่ซะ 1 ครั้ง

เพิ่มเติม
ขั้นตอนนี้ถ้าการทำงานช้า หรือไม่สามารถ Stop / Start ได้ ให้ทำการ Restart เครื่อง Server ซะ 1 รอบ จากนั้นค่อยมาดู Service ว่าทำงานปกติหรือไม่

การปรับแต่ง php.ini ให้รองรับ SMTP

Windows Azure VM Windows Server SMTP Mail

ในไฟล์ php.ini จะต้องเซ็ตให้เป็น SMTP = localhost และ smtp_port = 25

กลับมายัง Portal Management ของ Windows Azure

Windows Azure VM Windows Server SMTP Mail

ภายใต้ VM เลือกเมนู ENDPOINTS

Windows Azure VM Windows Server SMTP Mail

ADD

Windows Azure VM Windows Server SMTP Mail

ADD ENDPOINT

Windows Azure VM Windows Server SMTP Mail

ตั้งชื่อเป็น MAIL และกำหนด PRIVATE/PUBLIC เป็น 25

Windows Azure VM Windows Server SMTP Mail

ได้เรียบร้อยแล้ว

จากนั้นทดสอบการทำงานของ SMTP ด้วยการเขียน Script ของ PHP แบบง่าย ๆ ดังนี้

TestMail.php
<html>
<head>
<title>ThaiCreate.Com PHP Sending Email</title>
</head>
<body>
<?php
	$strTo = "[email protected]";
	$strSubject = "Test sending mail";
	$strHeader = "From: [email protected]";
	$strMessage = "My Body & My Description";
	$flgSend = mail($strTo,$strSubject,$strMessage,$strHeader); 
	if($flgSend)
	{
		echo "Email sending.";
	}
	else
	{
		echo "Email cannot send.";
	}
?>
</body>
</html>

Script สำหรับทดาอบการส่งอีเมล์บน VM Windows Server

Windows Azure VM Windows Server SMTP Mail

ถ้า SMTP สามารถส่งออกได้ อีเมล์ก็จะไปถึงปลายทางดังรูป


สำหรับบทความถัดไปจะแนะนำเกี่ยวกับการ กำหนด CNAME เพื่อ Custom Domain ให้ VM นี้รันภายใต้ชื่อเว็บไซต์ Domain ที่เราต้องการ








บทความถัดไปที่แนะนำให้อ่าน

   
Share


ช่วยกันสนับสนุนรักษาเว็บไซต์ความรู้แห่งนี้ไว้ด้วยการสนับสนุน Source Code 2.0 ของทีมงานไทยครีเอท


ลองใช้ค้นหาข้อมูล


   


Bookmark.   
       
  By : ThaiCreate.Com Team (บทความเป็นลิขสิทธิ์ของเว็บไทยครีเอทห้ามนำเผยแพร่ ณ เว็บไซต์อื่น ๆ)
  Score Rating :  
  Create/Update Date : 2013-06-12 08:37:46 / 2017-03-24 16:55:51
  Download : No files
 Sponsored Links / Related

 
ขั้นตอนที่ 1 : การสร้าง VM ของ Windows Server บน VM - Windows Azure
Rating :

 
ขั้นตอนที่ 2 : การติดตั้ง IIS Web Server การสร้าง Endpoint เพื่อบริการ Web Server
Rating :

 
ขั้นตอนที่ 3 : การสร้าง Setup FTP Account และ FTP ไฟล์ไปที่ VM (Windows Server)
Rating :

 
ขั้นตอนที่ 4 : ติดตั้ง PHP สำหรับ IIS บน VM Windows Server ของ Windows Azure
Rating :

 
ขั้นตอนที่ 5 : การติดตั้ง MySQL และสร้าง User สำหรับ MySQL บน Windows Server
Rating :

 
ขั้นตอนที่ 7 : การแก้ไข CNAME เกำหนด Custom Domain เพื่อใช้งานจริงบน VM
Rating :

 
ขั้นตอนที่ 8 : การตรวจสอบ Scale , Monitor และรายละเอียดค่าบริการอื่น ๆ
Rating :


ThaiCreate.Com Forum


Comunity Forum Free Web Script
Jobs Freelance Free Uploads
Free Web Hosting Free Tools

สอน PHP ผ่าน Youtube ฟรี
สอน Android การเขียนโปรแกรม Android
สอน Windows Phone การเขียนโปรแกรม Windows Phone 7 และ 8
สอน iOS การเขียนโปรแกรม iPhone, iPad
สอน Java การเขียนโปรแกรม ภาษา Java
สอน Java GUI การเขียนโปรแกรม ภาษา Java GUI
สอน JSP การเขียนโปรแกรม ภาษา Java
สอน jQuery การเขียนโปรแกรม ภาษา jQuery
สอน .Net การเขียนโปรแกรม ภาษา .Net
Free Tutorial
สอน Google Maps Api
สอน Windows Service
สอน Entity Framework
สอน Android
สอน Java เขียน Java
Java GUI Swing
สอน JSP (Web App)
iOS (iPhone,iPad)
Windows Phone
Windows Azure
Windows Store
Laravel Framework
Yii PHP Framework
สอน jQuery
สอน jQuery กับ Ajax
สอน PHP OOP (Vdo)
Ajax Tutorials
SQL Tutorials
สอน SQL (Part 2)
JavaScript Tutorial
Javascript Tips
VBScript Tutorial
VBScript Validation
Microsoft Access
MySQL Tutorials
-- Stored Procedure
MariaDB Database
SQL Server Tutorial
SQL Server 2005
SQL Server 2008
SQL Server 2012
-- Stored Procedure
Oracle Database
-- Stored Procedure
SVN (Subversion)
แนวทางการทำ SEO
ปรับแต่งเว็บให้โหลดเร็ว


Hit Link
   







Load balance : Server 03
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่