ผู้ติดตาม

วันเสาร์ที่ 13 พฤศจิกายน พ.ศ. 2553

Configure Mercury mail transport system for external mail

Usually I develope my projects locally on my pc. Needless to say that you sometimes have to send an email from your script to external mail to check if everything is fine. So you need to configure your system in a way that your local apache webserver is able to send mail to external addresses. I always use XAMPP for Windows because it contains everything you need for developing PHP applications as well as all the stuff for sending mails: fake sendmail und Mercury Mail Transport System. I reference to XAMPP 1.6.5 (for Windows) and Mercury 4.5 here. Mercury is already pre-configured in XAMPP - all settings that I don't explicitly address stay as they are

I'm writing this because I'm not a mail professional and read a lot of tutorials and none of them really worked. So I extracted what I needed and put it all together. An important assumption for this tutorial is that you have your own SMTP server, for example the one that your webspace hoster provides.

So let's get started:

  1. start Mercury (using the XAMPP Controlpanel) and then open the admin panel.
  2. first of all we disable the HTTP server of Mercury so that it doesn't conflict with the apache:
    1. "Configuration" -> "Protocol modules"
    2. disable the check "MercuryB HTTP web server"
    3. I also disabled "Mercury IMAP4rev1 server" because I won't need that one
    4. leave the window opened, we'll need it immediatly
  3. to be able to send external mail we have to disable "MercuryE SMTP end-to-end delivery client" in the same dialog and enable "MercuryC SMTP relaying client". Click "OK" and restart Mercury!
  4. now let's configure Mercury in general:
    1. "Configuration" -> "Mercury core module", tab "General"
    2. we want to send from localhost, therefore we check if "localhost" is the value of "internet name for this system" and adjust that if not
    3. all other settings stay the same as they are already configured, but we'll have a look to the checkboxes beneath:
    4. disable all but "Send copies of all errors to postmaster"
    5. check under the tab "Local domains" if the entry "localhost (local host or server) localhost (internet name)" is there, if not, add it
    6. click "OK" and leave the dialog
  5. next we focus on the MercuryS SMTP Server for outgoing emails:
    1. "Configuration" -> "MercuryS SMTP Server"
    2. choose the tab "General" and add a wonderful name for your SMTP server under "Announce myself as", simply fill in any name, I've chosen "CS SMTP".
    3. under "Listen on TCP/IP port" fill in "25", that's the SMTP port
    4. add "127.0.0.1" to "IP interface to use", that's the local IP of your pc. With the IP of the pc within the network (192.168.0.X) it doesn't work (at least for me)
    5. now we limit the access to the server so that only our local machine can access it:
      1. under "Connection Control" click on "Add restriction" and add the IP range from "127.0.0.1" till "127.0.0.1" (it's that simple, isn't it?)...
      2. and select "Allow connections"...
      3. and leave all checkboxes deselected
    6. with a click on "OK" we quit the dialog and we're looking forward to the next one
  6. now let's configure the MercuryP POP3 Server:
    1. "Configuration"-> "MercuryP POP3 Server", select the tab "General"
    2. "Listen on TCP port" -> "110" and "IP interface to use" -> "127.0.0.1"
    3. choose the tab "Connection control" and proceed as already written under 5.5 (see above)
    4. that's it already, leave the dialog by clicking "OK"
  7. now we have the important one "MercuryC SMTP Client"
    1. "Configuration" -> "MercuryC SMTP Client"
    2. to send mail to external addresses we need to have an external SMTP server. If you're renting webspace somewhere and have mail included then you normally have access to a SMTP server. My webspace is hosted at HostEurope and I'll use the SMTP of my domain. Without such an external server the whole thing won't work because domain names won't be resolved among other things. I've chosen this path because I didn't feel like configuring around the whole day.
    3. enter the address of your SMTP under "Smart host name", for example "mail.meinedomain.com"
    4. depending on the way you access the server fill the values under "Connection port/type":
      1. for a "normal" SMTP that would probably be port 25 and "Normal (no SSL encryption)"
      2. I access my SMTP via SSL, that would be port 465 and "SSL encryption using direct connection"
      3. if you have other parameters simply try around a little
    5. we finally fill in the "Login username" and the "Password" that normally is supplied by your webhost and we've nearly finished...
  8. let's check the Mercury users that are normally pre-configured:
    1. "Configuration"-> "Manage local users"
    2. there should be at least the users "Admin" and "postmaster", both with administrative rights. If not you have to add them.
  9. now we finished with Mercury, but we still need to configure PHP for sending mail with our scripts:
    1. we search and open the appropriate php.ini, using XAMPP you find it under "xampp/php/php.ini" in newer version and under "xampp/apache/bin/php.ini" in older versions
    2. we search for "[mail function]"...
    3. and we add/adjust the following:
      1. "SMTP = localhost"
      2. "smtp_port = 25"
      3. "sendmail_from = postmaster@localhost"
    4. save the php.ini and restart the Apache
  10. now everything should work! But we'll test it first:
    1. within Mercury choose "File" -> "Send mail message" and send an email for testing purposes, I've chosen to send it to my googlemail account
    2. if the windows in Mercury are at sixes and sevens, choose "Window" -> "Tile" enjoy the view
    3. within the window "Mercury Core Prozess" we'll see our test mail at first:
      1. "13:38:41 JOB XXXXXX: from postmaster@localhost (local) To: XXX@googlemail.com (non-local) (JOB XXXXXX) -OK"
    4. the mail was received in Mercury and processed, after some seconds the window "Mercury SMTP client (relay version)" should show some actions:
      1. "05 Jan 2008 13:39, Servicing job XXXXXX ...OK"
      2. if you see this message, everything went fine and the mail was sent!
      3. if you don't get the message you have to find out why, possible reasons could be:
        1. wrong connection values for the SMTP server
        2. SMTP server doesn't allow relaying (from your host)
    5. now we'll test the whole thing from a PHP script and we'll write a wonderful one-liner into a PHP file:
      1. "mail('xxx@googlemail.com', 'Mercury test mail', 'If you can read this, everything was fine!');"
      2. call the PHP file within your browser, a command window should pop up shortly (or maybe not), it's from the fake sendmail of XAMPP, and focus back on Mercury:
        1. the produre is the same as above only that the SMTP server receives the mail from php before everything else happens
        2. you can watch this in the window "Mercury SMTP Server" and should see something like this: Mercury SMTP

I hope that worked for you, if not, feel free to leave a comment but as I already said, I'm not a professional but I'll help you as far as I can!

EDIT: If you get the error message "SMTP server response: 553 We do not relay non-local mail, sorry." while sending from PHP go to Mercury under MercuryS -> Connection Control -> "Uncheck Do not Permit SMTP relaying to non-local mail" an check this option. Should fix the problem. Thanks to ron!

when i back to be alone

ผมไม่เคยลืมผู้หญิงคนนี้เลย จะเป็นเพราะอะไรใจผมคงรู้คำตอบดีอยู่แล้ว ในช่วงเวลาที่ผ่านมาหลายปี ช่วงเวลานั้นไม่สามารถทำให้ผมลืมคิดถึงเธอได้แม้แต่นาทีเดียว

แต่ออีตมันก็คงเป็นเพียงแค่อดีต ในวันที่เรารักใครสักคน ใครสักคนนั้นอาจจะกำลังเดินห่างเราออกไปโดยที่เราไม่ทันสังเกตุ

ผมยังจำครั้งแรกที่เจอกับเธอได้ ครั้งแรกที่ได้พูดคุย ครั้งแรกที่เราได้มีเวลาได้อยู่ด้วยกัน ครั้งแรกที่เราทะเลาะกัน(และเป็นครั้งเดียว) ตลอดเวลา 1ปีที่เราได้ใช้ชีวิตอยู่ร่วมกัน

วันพฤหัสบดีที่ 6 กันยายน พ.ศ. 2550

ฟันคุต มันมาได้ไงเนี่ยยยยยยยยยย

ปวด ปวด ปวด !! T_T

ตื่นมาเมื่อเช้าเพราะความเจ็บปวด งงมากว่าทำไมเมื่อเช้าปวดฟัน แปรงฟันตลอด อยู่ ๆ ฟันผุได้ไงเนี่ย??
ปล่าวเลย ฟันไม่ได้ผุ แต่นี่มัน ... นี่มัน... ฟันคุตนี่หว่า โอ้ยยยยยยยยย ปวด ทรมานจัง ตัวสั่นเหมือนจะเป็นไข้เลย แง้ ๆ ทำไงละคราวนี้ต้องผ่าเหรอ T_T ....

ปวดแบบนี้อย่าหวังพึ่งพายาพาราฯ เลย ช่วยอะไรไม่ได้เลยจริง ๆ เปิดกระทู้มาเจอแต่กระทู้ที่พูดถึงความน่ากลัวของฟันคุต การถอน การผ่า เขาบอกว่าถ้าอายุยังไม่มากให้รีบไป X-Ray หาดูซะ เจอก่อนผ่าก่อนตอนที่อายุยังน้อยจะไม่ทรมาน แล้วนี่ผม 30+ แล้ว แม่เจ้า..... แต่มันปวดมากมายจริง ๆ นะ เคยเห็นแต่คนอื่นปวด ก็ไม่คิอว่ามันจะปวดขนาดนี้ คิดแค่ว่ามันเหมือนปวดฟันทั่ว ๆ ไป กินยาพาราฯ หาพลาสเตอร์ยามาแปะก็ดีขึ้น หลังจากนั้นค่อยไปหาหมอฟันจัดการกันไป แต่นี่มันไม่ใช่ มันไม่ใช่...!!!!!!


ฟันคุด
เป็นฟันที่ไม่สามารถขึ้นในช่องปากได้ตามปกติ หรือขึ้นได้เพียงบางส่วน ตัวฟันซี่ที่พบฟันคุดบ่อยที่สุดคือ ฟันกรามซี่สุดท้ายและฟันเขี้ยวบน เนื่องจากเป็นฟันที่ขึ้นช้ากว่าฟันซี่อื่นๆ ทำให้ไม่มีที่ว่างขึ้นได้ ซึ่งตามปกติฟันกรามซี่สุดท้ายควรขึ้นเมื่ออายุ 16-22 ปี แต่หากเมื่อถึงช่วงอายุดังกล่าวแล้วยังไม่พบฟันขึ้น ควรพบทันตแพทย์เพื่อตรวจหาความผิดปกติแต่เนิ่นๆ เพื่อสามารถทำการรักษาก่อนที่จะมีอาการปวด

ฟันคุตรักษาอย่างไร....เหมือนถอนฟันหรือไม่
การถอนฟันในกรณีฟันผุ หรือมีความจำเป็นในการถอนฟันเพื่อร่วมกับการจัดฟัน ทันตแพทย์จะทำการถอนฟันด้วยเครื่องช่วยถอน โดยใช้ยาชาเฉพาะที่ และใช้เวลาไม่นาน ส่วนการรักษาฟันคุด ทันตแพทย์จะต้องทำการผ่าตัดฟันคุดออกแต่เป็นเพียงการผ่าตัดเล็ก โดยใช้ยาชาเฉพาะที่เท่านั้นยกเว้นฟันเขี้ยวบน ทันตแพทย์อาจพิจารณาจัดฟันร่วมด้วย เพื่อดึงฟันเขี้ยวขึ้นมาในตำแหน่งที่ปกติ เพื่อความสวยงามของฟัน ผู้ป่วยสามารถมีกิจวัตรได้ตามปกติ

มีฟันคุตไม่อยากผ่าออกได้หรือไม่
่เมื่อทันตแพทย์ตรวจพบว่าผู้ป่วยมีฟันคุดขึ้น วิธีการที่ดีที่สุดคือการผ่าตัดฟันคุดออกแต่เนิ่นๆ ก่อนที่จะมีอาการปวด และผ่าตัดได้ง่ายและมีผลข้างเคียงน้อยกว่าเมื่อเกิดอาการปวด-บวม ซึ่งหากปล่อยให้มีฟันคุด และไม่ผ่าตัดออกจะส่งผลให้เกิดอาการดังนี้ี้

  1. เกิดการอักเสบของเหงือกที่ปกคลุมฟันคุดอยู่ และหมักหมมเศษอาหารทำให้มีกลิ่นเหม็นและเกิดบวม
  2. เกิดปริทันต์อักเสบ บริเวณฟันข้างเคียงและทำให้ฟันผุง่าย เนื่องจากเศษอาหารติดง่ายทำความสะอาดยาก
  3. ฟันคุดมีแรงดันต่อฟันข้างเคียง ทำให้มีการละลายของรากฟันซี่นั้นๆ
  4. เกิดอาการปวดบริเวณกระดูกขากรรไกร เนื่องจากการติดเชื้อ หรือแรงกดดันต่อโพรงประสาทฟัน ที่มาหล่อเลี้ยงฟัน ที่ทอดยาวมาอยู่ใกล้ปลายรากฟันมากๆ บางครั้งทำให้เกิดอาการปวดศีรษะโดยไม่ทราบสาเหตุ
  5. ฟันคุดมีแรงดันทำให้เกิดการบิดเกของฟันข้างเคียง ฟันซี่หน้า และซี่ถัดไป
  6. บริเวณฟันคุดเป็นจุดอ่อนให้ขากรรไกรหักง่าย เมื่อเกิดอุบัติเหตุ หรือได้รับแรงกระแทก
  7. เยื่อหุ้มฟันคุดอาจทำให้เกิดถุงน้ำ (Cyst) โตขึ้นเรื่อยๆ และอาจเกิดมะเร็งกรามช้างตามมาได้
ข้อควรปฏิบัติหลังการถอนหรือผ่าฟันคุต

  1. กัดผ้าก๊อซให้แน่นเป็นเวลา 2 ชั่วโมง หลังการถอนฟัน หรือผ่าตัด ถ้าเลือดยังไหลให้ใช้ผ้าก๊อซที่สำรองไว้ชุบน้ำหมาดๆกัดต่อจนเลือดหยุด
  2. ควรประคบนอกปากบริิเวณที่ถอนฟันหรือบริเวณที่ผ่าตัดด้วยน้ำแข็งใส่ถุงพลาสติกหรือเจลเย็น โดยห้ามอมน้ำแข็งในปาก
  3. แปรงฟันได้ตามปกติโดยหลีกเลี่ยงการกระแทกกับแผลที่ถอนฟันหรือผ่าตัด บ้วนน้ำเพียงเบาๆ
  4. ห้ามบ้วนปากโดยใช้น้ำยาบ้วนปากใดๆที่ทันตแพทย์มิได้สั่งให้ เนื่องจากน้ำยาบ้วนปากที่มีขายในท้องตลาดจะมีความรุนแรงเกินไป ทำให้แผลระคายเคืองและหายช้า
  5. ในคนไข้เ็ด็กที่ถอนฟันหน้า หลังถอนฟันจะยัมีฤทธิ์ยาชาอยู่ ผู้ปกครองควรระวังไม่ให้เด็กเผลอกัดริมฝีปากจะทำให้เป็นแผลได้
  6. หากมีอาการปวดให้รับประทานยาแก้ปวด ตามแพทย์สั่ง
  7. ห้ามใช้นิ้วมือ ไม้จิ้มฟันแคะ หรือดูดแผลเล่น
  8. ห้ามดื่มสุราของมึนเมา อาหารเผ็ดจัดหรือร้อนจัด
  9. ถ้ามีอาการบวม หรือรู้สึกผิดปกติควรกลับมาพบทันตแพทย์ตรวจ
  10. ถ้ามีการเย็บแผล พบทันตแพทย์ตัดไหมภายหลังการผ่าตัด 7 วัน
ค่ารักษา
ผ่าตัดฟันคุด ราคา 1,500 - 3,500 บาท


ข้อมูลจาก โรงพยาบาลยันฮี ครับ
http://www.blogger.com/www.yanhee.co.th/yhh/th/dntl/dntl_tonb.asp

วันพฤหัสบดีที่ 23 สิงหาคม พ.ศ. 2550

ความทรงจำที่หายไป

ระหว่างที่ได้กลับมาที่ชะอำ ก็มีแต่งาน งาน และงาน เวลาดิ้งแทบไม่มี

ทำให้ผมนึกได้ว่าลืมใครบางคนไว้ข้างหลัง เฮ้อ... ไม่ได้โทรหาเธอเลย เป็นไงบ้างก็ไม่รู้ วันนี้คงต้องโทรหาหน่อยแล้วละว่าเธอเป็นไงบ้าง อยากรู้จังอารมณ์ของเธอตอนที่รับโทรศัพท์จะเป็นไง เดาไม่ออกเลยจริง ๆ จะเฉย ๆ หรือน้อยใจ แต่น่าจะเป็นอันแรกมากว่ามั้ง แต่ก็คิดถึงเธอเหมือนกัน ผมนี่แย่จริง ๆ เวลาทำงานไม่ลืมหูลืมตานึกถึงใคร อาจจะเป็นเพราะคืนนั้นที่ได้คุยกับเธอในตอนที่ไปซื้อของที่ Lotus แล้วเธอพูดอะไรหลาย ๆ อย่างทำให้ผมเองก็รู้สึกท้อแท้เหมือนกัน แต่ก็ยังปากแข็งยืนกานว่าจะยังอยู่ข้าง ๆ เธอต่อไป จนกว่าเธอจะมองเห็น แต่ถึงตอนนี้มันรู้สึกแตกต่างออกไปจากความรู้สึกในวันนั้นจริง ๆ ไม่รู้ว่าเกิดอะไรขึ้น คงเป็นเพราะว่าผมไม่ชอบ กับความรู้สึกพวกนี้ เป็นความรู้สึกที่ทำให้ผมเองรู้สึกว่าต้องการเอาชนะ เพราะรู้นิสัยตัวเองดีว่าถ้าเอาชนะ มันจะไม่เกิดความรัก หรือความรู้สึกห่วงใยใด ๆ ขึ้นมาเลย มันจะเป็นแค่ความสะใจ สมใจที่ได้ทำให้มันเกิดขึ้นและชนะใจเธอมากกว่า ถึงต้องดึงตัวเองออกมาห่างแบบนี้ แต่ก็บอกเธอไปแล้วเหมือนกันกับความรู้สึกที่พูดถึงเมื่อสักครู่นี้ เฮ้อ... ถอนหายใจอีกครั้ง

ทำไมชีวิตคนเรามันยากจัง

หยุดรักเขาก่อนได้มั้ย

หยุดรักเขาก่อนได้มั้ย อิงค์ อะชิตะ
Intro :-
ไม่อาจทนเห็นเธอ อยู่อย่างทรมาน เหนื่อยมานานด้วยการทุ่มเทใจ
อยากบอกให้เขาลืม ให้เขาทิ้งเธอไป แต่ในใจกลับกลัวเธอทุกข์เกินทน
อยากเก็บรอยน้ำตา ปัดกวาดความช้ำใจ จับโยนไปให้มันไกลตัวเธอ
อยากปลอบโยนหัวใจ ที่เขาเฝ้ารังแก ไม่เคยแคร์ว่าตัวเธอนั้นเสียใจ
แค่อยากจะขอให้เธอไปจากเขา เธออาจปวดร้าวและคงต้องเศร้าใจ
หยุดรักเขาก่อนได้มั้ย ก่อนหัวใจเธอต้องเจ็บ อาจจะปวดใจ
หยุดรักเขาก่อนได้มั้ย อย่าให้ใจเธอทนเจ็บอีกต่อไป ... อาจจะขาดใจ
แค่อยากจะขอให้เธอไปจากเขา เธออาจปวดร้าวและคงต้องเศร้าใจ
หยุดรักเขาก่อนได้มั้ย ก่อนหัวใจเธอต้องเจ็บ อาจจะปวดใจ
หยุดรักเขาก่อนได้มั้ย อย่าให้ใจเธอทนเจ็บอีกต่อไป อาจจะขาดใจ จะได้มั้ย



วันนี้เหนื่อยมาก ๆ เมื่อวานประชุมตั้งแต่เที่ยงยันตีหนึ่งเลย แล้วก็ Config ระบบต่ออีกนิดหน่อย T_T
พอได้ยินเพลงนี้แล้ว เอะ? ไม่เคยฟัง เพราะดี เศร้าดี อืม.. ชอบ

วันอาทิตย์ที่ 19 สิงหาคม พ.ศ. 2550

ลางาน 2 วัน

ไม่สบาย ป่วยหยุดงานไปซะสองวัน คิดถึงเธอจังแต่ไม่ได้โทรหา ไม่ได้ sms ถึงไม่รู้ว่าเขาจะคิดยังไงบ้าง ประโยคสุดท้ายที่ได้ยินจากเธอคือ "ใช้คำผิดหรือปล่าว" แต่ไม่เป็นไร ถ้าเป็นไปไม่ได้จริง ๆ ก็ให้มันเป็นอยู่แบบนี้แหละ

ยังอยู่ชะอำอยู่เลย ถูกเลื่อนเวลากลับออกไปจากวันที่ 22 ส.ค. เป็น 25 ซะแล้วเรา เฮ้อ!! งานหน๋องาน

วันศุกร์ที่ 10 สิงหาคม พ.ศ. 2550

Cha-Am 3 day laster


สิ่งที่ผมค้นหาในวันนี้ ไม่ใช่ความรัก
แต่เป็นความรู้สึกดี สบายใจ และความห่วงใยจากเธอคนนั้น
จะมีสักกี่คน ค้นพบในสิ่งที่ตัวเองกำลังค้นหา ...
ความรักเป็นเพียงเครื่องปรุงแต่งชีวิต แต่วัตถุดิบหลักคือความเข้าใจ และความห่วงใย ซึ่งทำให้ก่อเกิดรสชาติแห่งความรัก