สอบถามเรื่องส่งเมล์

เริ่มโดย icenobu, 18 พฤศจิกายน 2013, 14:59:06

หัวข้อก่อนหน้า - หัวข้อถัดไป

0 สมาชิก และ 1 ผู้มาเยือน กำลังดูหัวข้อนี้

icenobu

อยากจะทำเช็คสถานะ server ว่า online หรือ offline  เมื่อเกิดเหตุการณ์ server ล่ม สถานะจะขึ้นว่า offline
แล้วให้มันส่งเมล์แจ้งอัตโนมัติ จะทำยังไงค่ะ


//Do this if it is closed
echo( "<font color='red'>Offline</font>");
}
if( $sock ){
//Do this if it is open
echo( "<font color='green'>Online</font>" );
fclose($sock);
}


:wanwan031: :wanwan031: :wanwan031:
มือใหม่หัดเขียนเว็บ O(x^^)o
[direct=http://petdeecare.com]สุนัขป่วย[/direct]
[direct=http://petdeecare.com]แมวป่วย[/direct]
[direct=http://petdeecare.com]กระต่ายป่วย[/direct]
[direct=http://www.petdeecare.com/index.php?topic=199.0]แจกสุนัข[/direct]
[direct=http://www.viptashop.com]จำหน่ายชุดเดรส[/direct]

smapan

[direct=http://cp.siamhostweb.com/cart.php?gid=1]จูมล่าโฮส สยามโฮสเว็บ[/direct] [direct=http://www.modty.com]modty.com[/direct]
[direct=http://www.apartment.in.th]รวมที่พัก เช่ารายวัน ที่พักเช่ารายเดือนมากที่สุดแจ่มจริง[/direct]
***Tel 083-757-1515 ติดปัญหา Joomla ตรงไหนรับปรึกษาฟรี โทรมาเถอะครับ ถ้าตอบได้ช่วยแน่นอน ไม่มีกั้ก. ***

icenobu

ลองใส่ตามนี้ไม่ได้ค่ะ

Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in

if( !$sock ){

//Do this if it is closed
echo( "<font color='red'>Offline</font>");

}  else {
mail( "[email protected]", "Test Email","Comment: $ip_cam" );
}
มือใหม่หัดเขียนเว็บ O(x^^)o
[direct=http://petdeecare.com]สุนัขป่วย[/direct]
[direct=http://petdeecare.com]แมวป่วย[/direct]
[direct=http://petdeecare.com]กระต่ายป่วย[/direct]
[direct=http://www.petdeecare.com/index.php?topic=199.0]แจกสุนัข[/direct]
[direct=http://www.viptashop.com]จำหน่ายชุดเดรส[/direct]

smapan

อ้างถึงจาก: icenobu ใน 18 พฤศจิกายน 2013, 15:57:33
ลองใส่ตามนี้ไม่ได้ค่ะ

Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in

if( !$sock ){

//Do this if it is closed
echo( "<font color='red'>Offline</font>");

}  else {
mail( "[email protected]", "Test Email","Comment: $ip_cam" );
}


คือ คุณต้อง เปิดใช้งานฟังก์ชั่น ส่งเมล์

และ ต้องติดตั้ง Mail Server ด้วยครับ

:P
[direct=http://cp.siamhostweb.com/cart.php?gid=1]จูมล่าโฮส สยามโฮสเว็บ[/direct] [direct=http://www.modty.com]modty.com[/direct]
[direct=http://www.apartment.in.th]รวมที่พัก เช่ารายวัน ที่พักเช่ารายเดือนมากที่สุดแจ่มจริง[/direct]
***Tel 083-757-1515 ติดปัญหา Joomla ตรงไหนรับปรึกษาฟรี โทรมาเถอะครับ ถ้าตอบได้ช่วยแน่นอน ไม่มีกั้ก. ***

MeenyFancy

Have a good trip.
[direct=http://petdeecare.com]สุนัขป่วย[/direct] [direct=http://petdeecare.com]แมวป่วย[/direct]
[direct=http://petdeecare.com]หนูป่วย[/direct] [direct=http://petdeecare.com]อาหารแมว[/direct] [direct=http://petdeecare.com]อาหารหมา[/direct]

icenobu

อ้างถึงจาก: smapan ใน 18 พฤศจิกายน 2013, 16:04:49
อ้างถึงจาก: icenobu ใน 18 พฤศจิกายน 2013, 15:57:33
ลองใส่ตามนี้ไม่ได้ค่ะ

Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in

if( !$sock ){

//Do this if it is closed
echo( "<font color='red'>Offline</font>");

}  else {
mail( "[email protected]", "Test Email","Comment: $ip_cam" );
}


คือ คุณต้อง เปิดใช้งานฟังก์ชั่น ส่งเมล์

และ ต้องติดตั้ง Mail Server ด้วยครับ

:P

ยังไม่เข้าใจ "เปิดใช้งานฟังก์ชั่น ส่งเมล์"

ไม่แน่ใจว่าลิ้งค์นี้หรือเปล่าค่ะ
http://www.select2web.com/appserv/ssl-appserv.html
มือใหม่หัดเขียนเว็บ O(x^^)o
[direct=http://petdeecare.com]สุนัขป่วย[/direct]
[direct=http://petdeecare.com]แมวป่วย[/direct]
[direct=http://petdeecare.com]กระต่ายป่วย[/direct]
[direct=http://www.petdeecare.com/index.php?topic=199.0]แจกสุนัข[/direct]
[direct=http://www.viptashop.com]จำหน่ายชุดเดรส[/direct]

smapan

อ้างถึงจาก: icenobu ใน 19 พฤศจิกายน 2013, 10:19:31
อ้างถึงจาก: smapan ใน 18 พฤศจิกายน 2013, 16:04:49
อ้างถึงจาก: icenobu ใน 18 พฤศจิกายน 2013, 15:57:33
ลองใส่ตามนี้ไม่ได้ค่ะ

Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in

if( !$sock ){

//Do this if it is closed
echo( "<font color='red'>Offline</font>");

}  else {
mail( "[email protected]", "Test Email","Comment: $ip_cam" );
}


คือ คุณต้อง เปิดใช้งานฟังก์ชั่น ส่งเมล์

และ ต้องติดตั้ง Mail Server ด้วยครับ

:P

ยังไม่เข้าใจ "เปิดใช้งานฟังก์ชั่น ส่งเมล์"

ไม่แน่ใจว่าลิ้งค์นี้หรือเปล่าค่ะ
http://www.select2web.com/appserv/ssl-appserv.html

ตอนนี้ใช้ mail server อะไรอยู่ครับ
[direct=http://cp.siamhostweb.com/cart.php?gid=1]จูมล่าโฮส สยามโฮสเว็บ[/direct] [direct=http://www.modty.com]modty.com[/direct]
[direct=http://www.apartment.in.th]รวมที่พัก เช่ารายวัน ที่พักเช่ารายเดือนมากที่สุดแจ่มจริง[/direct]
***Tel 083-757-1515 ติดปัญหา Joomla ตรงไหนรับปรึกษาฟรี โทรมาเถอะครับ ถ้าตอบได้ช่วยแน่นอน ไม่มีกั้ก. ***

icenobu

domain ที่ใช้ทำผูกกับ hotmail ไว้อ่ะค่ะ แบบนี้ได้ไหมค่ะ  :-X
มือใหม่หัดเขียนเว็บ O(x^^)o
[direct=http://petdeecare.com]สุนัขป่วย[/direct]
[direct=http://petdeecare.com]แมวป่วย[/direct]
[direct=http://petdeecare.com]กระต่ายป่วย[/direct]
[direct=http://www.petdeecare.com/index.php?topic=199.0]แจกสุนัข[/direct]
[direct=http://www.viptashop.com]จำหน่ายชุดเดรส[/direct]

smapan

อ้างถึงจาก: icenobu ใน 19 พฤศจิกายน 2013, 11:27:57
domain ที่ใช้ทำผูกกับ hotmail ไว้อ่ะค่ะ แบบนี้ได้ไหมค่ะ  :-X

ทำได้ครับ
ใช้ SMTP ของ hotmail ได้เลยครับ
ดูตัวอย่าลิ้งนี้ครับ (ในตัวอย่างใช้ของ กูเกิลให้เปลี่ยนให้ตรงกับที่ใช้ปัจจุบันครับ)

http://stackoverflow.com/questions/4963688/how-to-send-email-from-php-without-smtp-server-installed

โดยใน ตัวอย่างจะใช้ PHPMailer
สามารถดาวน์โหลดได้ที่ https://github.com/Synchro/PHPMailer/archive/master.zip
หลังจากที่ดาวน์โหลดไฟล์มาแล้วให้แตกไฟล์ออกมา จะมีไฟล์ของ PHPMailer
ให้เรา include ไฟล์ class.phpmailer.php ไปใน script ที่เราต้องการส่งอีเมล์
[direct=http://cp.siamhostweb.com/cart.php?gid=1]จูมล่าโฮส สยามโฮสเว็บ[/direct] [direct=http://www.modty.com]modty.com[/direct]
[direct=http://www.apartment.in.th]รวมที่พัก เช่ารายวัน ที่พักเช่ารายเดือนมากที่สุดแจ่มจริง[/direct]
***Tel 083-757-1515 ติดปัญหา Joomla ตรงไหนรับปรึกษาฟรี โทรมาเถอะครับ ถ้าตอบได้ช่วยแน่นอน ไม่มีกั้ก. ***

icenobu

อ้างถึงจาก: smapan ใน 19 พฤศจิกายน 2013, 11:58:42
อ้างถึงจาก: icenobu ใน 19 พฤศจิกายน 2013, 11:27:57
domain ที่ใช้ทำผูกกับ hotmail ไว้อ่ะค่ะ แบบนี้ได้ไหมค่ะ  :-X

ทำได้ครับ
ใช้ SMTP ของ hotmail ได้เลยครับ
ดูตัวอย่าลิ้งนี้ครับ (ในตัวอย่างใช้ของ Googleให้เปลี่ยนให้ตรงกับที่ใช้ปัจจุบันครับ)

http://stackoverflow.com/questions/4963688/how-to-send-email-from-php-without-smtp-server-installed

โดยใน ตัวอย่างจะใช้ PHPMailer
สามารถดาวน์โหลดได้ที่ https://github.com/Synchro/PHPMailer/archive/master.zip
หลังจากที่ดาวน์โหลดไฟล์มาแล้วให้แตกไฟล์ออกมา จะมีไฟล์ของ PHPMailer
ให้เรา include ไฟล์ class.phpmailer.php ไปใน script ที่เราต้องการส่งอีเมล์

ขอบคุณมากค่ะ พอเข้าใจแล้ว
:wanwan017: :wanwan017: :wanwan017:
มือใหม่หัดเขียนเว็บ O(x^^)o
[direct=http://petdeecare.com]สุนัขป่วย[/direct]
[direct=http://petdeecare.com]แมวป่วย[/direct]
[direct=http://petdeecare.com]กระต่ายป่วย[/direct]
[direct=http://www.petdeecare.com/index.php?topic=199.0]แจกสุนัข[/direct]
[direct=http://www.viptashop.com]จำหน่ายชุดเดรส[/direct]