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 > PHP > PHP Forum > ผมทำหน้าการส่งเมล์ ครับ แต่เมล์ไม่ส่งเข้า hotmail อะครับ แต่ถ้าเป็น gmail ส่งเข้านะครับ



 

ผมทำหน้าการส่งเมล์ ครับ แต่เมล์ไม่ส่งเข้า hotmail อะครับ แต่ถ้าเป็น gmail ส่งเข้านะครับ

 



Topic : 100637



โพสกระทู้ ( 545 )
บทความ ( 0 )



สถานะออฟไลน์




ผมทำหน้าการส่งเมล์ ครับ แต่เมล์ไม่ส่งเข้า hotmail อะครับ แต่ถ้าเป็น gmail ส่งเข้านะครับ

อยากทราบว่าเป็นเพราะอะไรหรอครับ

Code (PHP)
<?php
session_start();
if($_GET["sendnew"]==1)
{
include "config.php";
$usrresult = mysql_db_query($dbname,"select email,domain from ".$fix."user where userid='1'  ");

}else{

if( (!$_SESSION["username"]) || (!$_SESSION["password"]) ){ session_destroy(); exit; }
include "config.php";
$usrresult = mysql_db_query($dbname,"select email,domain from ".$fix."user where userid='1' and username='".$_SESSION["username"]."' and password='".$_SESSION["password"]."'");
if(!mysql_num_rows($usrresult)) {session_destroy(); exit; }

}



$site_arr = mysql_fetch_array($usrresult);
$random_hash = md5(date('r', time())); 


$MSG2 = "--PHP-alt-$random_hash\r\nContent-Type: text/plain; charset=\"tis-620\"\r\nContent-Transfer-Encoding: 7bit\r\n\r\n";

$MSG2 .= str_replace("&nbsp;","",strip_tags($_POST["story"]));

$MSG2 .= "\r\n\r\n--PHP-alt-$random_hash\r\nContent-Type: text/html; charset=\"tis-620\"\r\nContent-Transfer-Encoding: 7bit\r\n\r\n";

$emailcontact = explode(",",$site_arr[0]);

$headers = "From: ".$site_arr[1]."<".$emailcontact[0].">\r\nReply-To: ".$emailcontact[0]."\r\nReturn-Path: ".$emailcontact[0]."\r\nContent-Type: multipart/alternative; boundary=\"PHP-alt-".$random_hash."\"\r\n\r\n"; 


$MSG = "
<center>
<table width=650 cellspacing=1 cellpadding=2 bgcolor=gray>
<tr bgcolor=white><td><table width=100%><tr><td width=128><img src=\"http://www.cawaii-club.com/img/logo.png\" border=0></td><td align=right><font face=\"tahoma\" color=FF3366 size=3><b>Newsletter ข่าวสารจาก ".$site_arr[1]."</b></font></td></tr></table></td></tr>
<tr><td valign=top bgcolor=white colspan=2>
<table width=\"100%\" height=400 cellspacing=0 cellpadding=20>
<tr><td valign=top><div align=right><font face=\"tahoma\" size=2>Date: ".date("d-m-Y")."</font></div><br><center><font face=\"tahoma\" size=3><b>";


$sending=0;
if($_GET["sendnew"]==1)
{
$sql = mysql_db_query($dbname,"select * from ".$fix."news");
if(mysql_num_rows($sql)>0)
	{
$narr=@mysql_fetch_array($sql);
$MSG .= stripslashes($narr[1])."</b></font></center><br><font face=\"tahoma\" size=2>";
$MSG .= stripslashes($narr[2]);
$sending=1;
	}

}else{

$MSG .= stripslashes($_POST["m1"])."</b></font></center><br><font face=\"tahoma\" size=2>";
$MSG .= stripslashes($_POST["story"]);

}

$MSG .= "</font></td></tr></table>
<br><br><div align=center><a href=\"http://".$site_arr[1]."\" target=\"_blank\"><font face=\"tahoma\" size=2 color=FF3366>www.".$site_arr[1]."</font></a><br><br></div>
</td></tr>
</table>
</center>";

$MSG2 .=  $MSG;

$MSG2 .= "\r\n\r\n--PHP-alt-".$random_hash."--";


if(!isset($_GET["sendnew"]))
{
echo "<HTML>
<HEAD>
<TITLE>Newsletter</TITLE>
<META HTTP-EQUIV=\"CONTENT-TYPE\" CONTENT=\"TEXT/HTML; CHARSET=TIS-620\">
</HEAD>
<BODY bgcolor=cccccc>";
echo $MSG;
echo "</BODY></HTML>";
}



if( (isset($_POST["toem"])) && ($_GET["send"]==1) )
{
if( (eregi("gmail",$_POST["toem"])) || (eregi("yahoo",$_POST["toem"])) )
	{
$headers = str_replace("\r\n","\n",$headers);
$MSG2 = str_replace("\r\n","\n",$MSG2);
	}

if(@mail(trim($_POST["toem"]),$_POST["m1"],$MSG2,$headers))
echo "<script language=javascript>alert('ส่งอีเมล์ถึง ".$_POST["toem"]." เรียบร้อยแล้ว'); window.close();</script>";
}






if($sending==1)
{
$thistime=time();
$sendtime = ($thistime+500);
$file=@file("time.txt");
if($thistime>=$file[0])
	{
$startwrite = @fopen("time.txt", "w");
fputs($startwrite,$sendtime);
fclose($startwrite);

$sql2 = mysql_db_query($dbname,"select id,email,news from ".$fix."member where news!='1' order by id asc limit 2");
if(mysql_num_rows($sql2)>0)
	{
while($arr=mysql_fetch_array($sql2))
		{
$headers = str_replace("\r\n","\n",$headers);
$MSG2 = str_replace("\r\n","\n",$MSG2);

@mail($arr[1],stripslashes($narr[1]),$MSG2,$headers);
mysql_db_query($dbname,"update ".$fix."member set news='1' where id='$arr[0]' ");
sleep(1);
		}
		mysql_free_result($sql2);
	}else{
 mysql_db_query($dbname,"delete from ".$fix."news");
 mysql_db_query($dbname,"update ".$fix."member set news='' ");
	}
	}
	}




mysql_close($connection);
?>




Tag : PHP, MySQL









ประวัติการแก้ไข
2013-09-18 11:50:49
Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2013-09-18 11:29:52 By : tangsupap View : 735 Reply : 4
 

 

No. 1



โพสกระทู้ ( 455 )
บทความ ( 0 )



สถานะออฟไลน์


ลองตรวจ ดู ใน junk mail รึยังครับ






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-09-18 11:51:55 By : yamcrocodile
 


 

No. 2



โพสกระทู้ ( 545 )
บทความ ( 0 )



สถานะออฟไลน์


ดูแล้วครับ ไม่มีอะไรส่งมาเลยครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-09-18 11:52:32 By : tangsupap
 

 

No. 3



โพสกระทู้ ( 455 )
บทความ ( 0 )



สถานะออฟไลน์


ลองดูอันนี้ครับ
http://code.google.com/a/apache-extras.org/p/phpmailer/
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-09-18 11:56:12 By : yamcrocodile
 


 

No. 4



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

ตามนั้นครับ ใชการส่งผ่าน Class และ SMTP ครับ



แจกฟรี Script ส่งอีเมล์แบบ SMTP / POP ของ PHP ที่สามารถใช้งานได้จริง ๆ

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-09-18 12:55:45 By : mr.win
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : ผมทำหน้าการส่งเมล์ ครับ แต่เมล์ไม่ส่งเข้า hotmail อะครับ แต่ถ้าเป็น gmail ส่งเข้านะครับ
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 00
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 อัตราราคา คลิกที่นี่