MailCatcher (Easy catches mail from SMTP server)

      วันนี้ผมจะมาแนะนำตัวโปรแกรม ( เอาเป็นว่าใช้คำนี้ละกัน พอดีนึกคำไม่ออกTT ) ที่ผมนำประยุกต์ใช้งานกับ ระบบ Authen ของ Blog ที่ผมสร้างขึ้นมา โดยมันมีชื่อว่า MailCatcher ซึ่งเป็นโปรแกรมที่โครตทำงานง่ายๆแบบปอกกล้วยเข้าปาก บน SMTP Server โดยที่หน้าที่สำคัญ มันก็บอกชัดเจนอยู่แล้ว  Mail = E-mail , Catcher= ดักจับ สรุปคือ มันเอาไว้ใช้ดักจับข้อความอะไรก็แล้วแต่ที่ส่งออกไปแสดงในเว็บอินเตอร์เฟส
     โดยขั้นตอนการใช้ง่ายแสนง่ายติดตั้งและใช้งานได้ภายใน 2 นาที เพียงแค่
            1.ติดตั้งโปรแกรม gem install mailcatcher
            2.เปิดการทำงานโปรแกรม  mailcatcher
            3.Set ให้โปรแกรมส่ง mail ไปที่ smtp://localhost:1025(SMTP :/ / 127.0.0.1:1025 )
            4.เข้าดูที่ http://localhost:1080/
    จริงๆครับ มีแค่นี้จริงๆ ผมถึงกับเงิบเลยทีเดียว ง่ายแสนง่าย


การเซ็ท SMTP 

RVM

Under RVM your mailcatcher command may only available under the ruby you install mailcatcher into. To prevent this, and to prevent gem conflicts, install mailcatcher into a dedicated gemset and create wrapper scripts:
rvm default@mailcatcher --create do gem install mailcatcher
rvm wrapper default@mailcatcher --no-prefix mailcatcher catchmail

Rails

To set up your rails app, I recommend adding this to your environment/development.rb:
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = { :address => "localhost", :port => 1025 }

PHP

For projects using PHP, or PHP frameworks and application platforms like Drupal, you can set PHP's mail configuration in your php.ini to send via MailCatcher with:
sendmail_path = /usr/bin/env catchmail
You can do this in an Apache htaccess file or general configuration like so:
php_value sendmail_path "/usr/bin/env catchmail"
If you've installed via RVM this probably won't work unless you've manually added your RVM bin paths to your system environment's PATH. In that case, run which catchmail and put that path into the sendmail_path directive above instead of /usr/bin/env catchmail.

API

A fairly RESTful URL schema means you can download a list of messages in JSON from/messages, each message's metadata with /messages/:id.json, and then the pertinent parts with /messages/:id.html and /messages/:id.plain for the default HTML and plain text version,/messages/:id/:cid for individual attachments by CID, or the whole message with/messages/:id.source.

Features

  • Catches all mail and stores it for display.
  • Shows HTML, Plain Text and Source version of messages, as applicable.
  • Rewrites HTML enabling display of embedded, inline images/etc and open links in a new window. (currently very basic)
  • Can send HTML for analysis by Fractal.
  • Lists attachments and allows separate downloading of parts.
  • Download original email to view in your native mail client(s).
  • Command line options to override the default SMTP/HTTP IP and port settings.
  • Mail appears instantly if your browser supports WebSockets, otherwise updates every thirty seconds.
  • Growl notifications when you receive a new message.
  • Runs as a daemon run in the background.
  • Sendmail-analogue command, catchmail, makes using mailcatcher from PHP a lot easier.
  • Written super-simply in EventMachine, easy to dig in and change.



Reference Office Site : MailCatcher.me

Comments

Popular posts from this blog

interpreter กับ compiler ต่างกันยังไง?

Source file not compile Dev C++ win 8, win 8.1 , win10

[PSU] วิธีการขอ License Win 7,8,8.1,10 ของแท้ฟรี