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,025

HOME > PHP > PHP Sending Mail > PHP Sending Email Using Gmail SMTP Account Authentication



Clound SSD Virtual Server

PHP Sending Email Using Gmail SMTP Account Authentication

PHP Sending Email Using Gmail SMTP Account Authentication เป็นการส่งอีเมล์ด้วย PHP โดยมีการเรียกใช้งาน Authen Account ของ Gmail ซึ่งจะต้องมี Account ของ Gmail ก่อน วิธีนี้เป็นวิธีหนึ่งที่สามารถช่วยลดปัญหาการส่งอีเมล์ไม่ถึงปลายทาง และสามารถส่งถึงปลายทางได้อย่างถูกต้อง เพราะการเรียกใช้ Server ของ Gmail จะมั่นใจได้ว่า IP ที่ได้ส่งออกไปไม่ติด Blacklist อย่างแน่นอน

IIS SMTP Virtual Server


phpSendMailGmail.php

<html>
<head>
<title>ThaiCreate.Com Tutorial</title>
</head>
<body>
<?php
	require_once('class.phpmailer.php');
	$mail = new PHPMailer();
	$mail->IsHTML(true);
	$mail->IsSMTP();
	$mail->SMTPAuth = true; // enable SMTP authentication
	$mail->SMTPSecure = "ssl"; // sets the prefix to the servier
	$mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server
	$mail->Port = 465; // set the SMTP port for the GMAIL server
	$mail->Username = "[email protected]"; // GMAIL username
	$mail->Password = "mypassword"; // GMAIL password
	$mail->From = "[email protected]"; // "[email protected]";
	//$mail->AddReplyTo = "[email protected]"; // Reply
	$mail->FromName = "Mr.Weerachai Nukitram";  // set from Name
	$mail->Subject = "Test sending mail."; 
	$mail->Body = "My Body & <b>My Description</b>";

	$mail->AddAddress("[email protected]", "Mr.Adisorn Boonsong"); // to Address

	$mail->AddAttachment("thaicreate/myfile.zip");
	$mail->AddAttachment("thaicreate/myfile2.zip");

	//$mail->AddCC("[email protected]", "Mr.Member ShotDev"); //CC
	//$mail->AddBCC("[email protected]", "Mr.Member ShotDev"); //CC

	$mail->set('X-Priority', '1'); //Priority 1 = High, 3 = Normal, 5 = low

	$mail->Send(); 
?>
</body>
</html>


Screenshot

PHP Send Email






   
Share


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


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


   


Bookmark.   
       
  By : ThaiCreate.Com Team (บทความเป็นลิขสิทธิ์ของเว็บไทยครีเอทห้ามนำเผยแพร่ ณ เว็บไซต์อื่น ๆ)
  Score Rating :  
  Create/Update Date : 2010-08-07 08:54:44 / 2017-03-25 00:40:37
  Download : Download  PHP Sending Email Using Gmail SMTP Account Authentication
 Sponsored Links / Related

 
PHP Sending Email / Send Mail
Rating :

 
PHP Sending Email Name Alias
Rating :

 
PHP Sending Email Cc and Bcc
Rating :

 
PHP Sending Email Reply-To Header
Rating :

 
PHP Sending Email ส่งอีเมล์ภาษาไทย กับ HTML Format (Thai Message)
Rating :

 
PHP Sending Email Attachment Files
Rating :

 
PHP Sending Email Contact Form
Rating :

 
PHP Sending Email Set Priority
Rating :

 
PHP Sending Email Upload Form & Attachment Files
Rating :

 
PHP Sending Email Multiple Array Upload Form & Attachment File
Rating :

 
PHP Sending Email Upload,Zip & Attachment Files
Rating :

 
PHP Sending Email Using SMTP Authentication
Rating :

 
PHP Mail Class (MIMEMAIL V 1.5)
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 อัตราราคา คลิกที่นี่