• Downloading from our site will require you to have a paid membership. Upgrade to a Premium Membership from 10$ a month today!

    Dont forget read our Rules! Also anyone caught Sharing this content will be banned. By using this site you are agreeing to our rules so read them. Saying I did not know is simply not an excuse! You have been warned.

Hướng dẫn [TUT] Gửi email từ localhost bằng Mercury Mail

VnSlo

New Member
Hi all,
Việc gửi mail từ localhost sẽ trở nên dễ dàng với bộ công cụ XAMPP.
http://www.apachefriends.org/en/xampp.html
Ở đây tôi trình bày việc cấu hình gửi email từ localhost sử dụng công cụ MercuryMail có sẵn trong XAMPP.
Sau khi tải về, bung nén chẳng hạn vào E:\xampp => Bạn có E:\xampp\xampp\htdocs.
Mở thư mục E:\xampp\xampp\Mercury Mail, tìm file MERCURY.INI và dán đè code sau vào:


Code:
#  MERCURY.INI generated by Mercury Setup
#
#
#  Sample Bindery Mode MERCURY.INI file (in fact, the one I use on
#  my production server). This one implements most of the possible
#  switches for each module, but you can edit it to do less if you
#  wish. All the fields shown below are described in the file
#  MGUIDE.HLP which is supplied in the Mercury archive.
#
#  Anything after a '#' to the end of the line is a comment and
#  is stripped out before parsing. Trailing and leading whitespace
#  is also stripped before parsing. Many sample commands have been
#  left in this file commented out for reference purposes.
#

[General]
myname:          localhost    # Canonical name for this server
timezone:        +0000    # Time Zone to add to date fields
file_api:        1    # Use the file api instead of queues
mailqueue:       E:\XAMPP\XAMPP\MERCURYMAIL\QUEUE    # Where mail should be put for delivery
smtpqueue:       E:\XAMPP\XAMPP\MERCURYMAIL\QUEUE    # Where the SMTP client should look for mail
newmail_path:    E:\XAMPP\XAMPP\MERCURYMAIL\MAIL\~N    # Where to find the users' WinPMail mailboxes.

[Protocols]
E:\XAMPP\xampp\MERCURYMAIL\mercurys.dll
E:\XAMPP\xampp\MERCURYMAIL\mercuryc.dll
E:\XAMPP\xampp\MERCURYMAIL\mercuryp.dll
E:\XAMPP\xampp\MERCURYMAIL\mercuryd.dll
E:\XAMPP\xampp\MERCURYMAIL\mercuryx.dll
E:\XAMPP\xampp\MERCURYMAIL\mercuryh.dll
E:\XAMPP\xampp\MERCURYMAIL\mercuryw.dll
E:\XAMPP\xampp\MERCURYMAIL\mercuryi.dll


[Mercury]
failfile:      E:\XAMPP\xampp\MERCURYMAIL\Mercury\FAILURE.MER    # Delivery failure notification template
confirmfile:   E:\XAMPP\xampp\MERCURYMAIL\Mercury\CONFIRM.MER    # Delivery confirmation template
aliasfile:     E:\XAMPP\xampp\MERCURYMAIL\Mercury\ALIAS.MER    # System-wide alias file
synfile:       E:\XAMPP\xampp\MERCURYMAIL\Mercury\SYNONYM.MER    # User synonym database
listfile:      E:\XAMPP\xampp\MERCURYMAIL\Mercury\LISTS.MER    # List of lists
logwidth:      30    # Width of address fields in logfile
retpath:       1    # Do/Don't use 'return-path' for errors
maxhops:       30    # Used to detect mailing loops
gullible:      0    # If NZ, don't validate 'From' fields
bitnethost:    cunyvm.cuny.edu    # Relay host for '.bitnet' rewrites
poll:          10   # Seconds between queue polling cycles
scratch:       E:\XAMPP\xampp\MERCURYMAIL\Scratch    # Where we can write temp files
returnlines:   15    # How many lines of failed messages to return
postmaster:    Admin    # NetWare UIC of postmaster
broadcast:     1    # Yes, we want broadcast notifications, but
receipts:      0    # ... no broadcasts for receipt confirmations
PM_notify:     1    # Do/Don't send errors to the postmaster
change_owner:  1    # Change message ownership to recipient
auto_tzone:    1    # If NZ, obtain timezone information from OS
LogLevel:      15    # System message reporting level
LogMax:        100    # Maximum number of system messages to store
RetryPeriod:   30    # Period between job retries (minutes)
MaxRetries:    16    # Maximum number of times a job can fail
TwoPasses:     1    # If NZ, process submission queue in 2 passes
Autoaddress:   0    # If NZ, auto-generate user addresses based on name
Daily_exit:    0    # If NZ, auto-restart each day after maintenance
No_Areply:     0    # If NZ, disable automatic replies system-wide
Alt_Forward:   0    # If NZ, allow alternate forwarding specification
Maint_hour:    2    # Hour for daily maintenance (24-hour clock)
Maint_min:     0    # Minute for daily maintenance
Retry_Mode:    0    # If NZ, use progressive backoff for queue retries
Local_DSNs:    1    # If NZ generate Delivery Status for local users only
DSN_time1:     10800    # Seconds deferred before first DSN is sent
DSN_time2:     86400    # Seconds deferred before second DSN is sent
DSN_time3:     259200    # Seconds deferred before third DSN is sent
Host_in_title: 0    # If NZ, show hostname in system tray and taskbar

[MercuryC]
Host : smtp.gmail.com
Failfile : E:\XAMPP\xampp\MERCURYMAIL\Mercury\FAILURE.MER
HELO : JMB
Poll : 30
Scratch : E:\XAMPP\xampp\MERCURYMAIL\Mercury
ReturnLines : 15
Timeout : 30
ESMTP : 1
Server_Port : 465
SMTP_Username: mercurymailer@gmail.com
SMTP_Password: andmad
SMTP_ConnFlags : 8
POP3_Auth : 0
Log_Verbose : 0

[MercuryE]
Poll : 15
Timeout : 60
# Session_logging : o:\mail\mercury\melogs
# Session_logmode : 1
# Nameservers : 139.80.64.1

[MercuryD]
scratch              :     E:\XAMPP\xampp\MERCURYMAIL\Mercury
# Timeout : 30
# Poll : 120               # How often to check hosts for new mail (seconds)

[MercuryS]
Debug : 1
Logfile : E:\XAMPP\xampp\MERCURYMAIL\Logs\MERCURYS.LOG
Timeout : 30
Relay : 1
Strict_Relay : 0
Allow_Illegals : 0
SMTP_Authentication : 0
Compliance_Settings : 0
Maximum_Failed_Rcpts : 4
Max_Relay_Attempts : 4
SSL_Mode : 0
ST_Blacklisting : 288
No_VRFY : 0
SMTP_ConnFlags : 0

[MercuryP]
Scratch : E:\XAMPP\xampp\MERCURYMAIL\Mercury
Stack : 32768
Mark_Read : 1
SSL_Mode : 0
Login_Disabled : 0
Timeout : 60

[MercuryX]
# Cmd_Delay: 10
# Cmd_Wait: 1
# IE4_Dialling: 0
# Use_ETRN: 1
# Clients_only: 1
# Sunday: 0800,1800,3,15,30,60
# Monday: 0830,2100,5,15,60,60
# Tuesday: 0830,2100,5,15,60,60
# Wednesday: 1500,1900,2,30,5,30
# Thursday: 0900,1900,2,30,0,0
# Friday: 0830,2100,5,15,60,60
# Saturday: 1031,1035,2,45,-1,0

# [Groups]
# group            :     GRP

[Domains]
localhost: localhost
localhost: localhost.net
localhost: localhost.org
localhost: localhost.com

[Maiser]
Maiser:          Maiser   # 'Username' of mail server account
Helpfile:        E:\XAMPP\xampp\MERCURYMAIL\Mercury\MAISER.HLP   # Help sent on failed maiser requests
Lookupfile:      E:\XAMPP\xampp\MERCURYMAIL\Mercury\MAISER.LKP   # Format file for the 'lookup' command
Send_dir:        E:\XAMPP\xampp\MERCURYMAIL\Mercury\SENDABLE   # Directory for the 'send' command
Logfile:         E:\XAMPP\xampp\MERCURYMAIL\Logs\MAISER.LOG   # Mail server log file
Notify:          E:\XAMPP\xampp\MERCURYMAIL\Mercury\TMP   # Dir. for pending 'notify' commands
NoList:          N   # If 'Y', disable the 'list' command
Local_only:      Y   # If 'Y', local 'notify' commands only

[MercuryH]
Logfile              :     E:\XAMPP\xampp\MERCURYMAIL\Logs\MERCURYH.LOG
# Addressbook : \\CLIO\SYS\SYSTEM\MERCURY\PH.PMR
# MOTD : \\CLIO\SYS\SYSTEM\MERCURY\PH-MOTD.TXT
# Administrator : postmaster@clio.pmail.gen.nz
Timeout : 30

[MercuryI]
Scratch : E:\XAMPP\xampp\MERCURYMAIL\SCRATCH
Timeout : 120
Server_Port : 143
Idle_Timeout : 1800
SSL_Mode : 0
Login_Disabled : 0

[MercuryB]
Scratch : E:\XAMPP\xampp\MERCURYMAIL\SCRATCH
# Logfile : o:\mail\tmp\mercuryb.log
Timeout : 120
Server_Port : 80
# Session_logging : o:\mail\mercury\mblogs
# Session_logmode : 0
Idle_Timeout : 1800
# URL_Base : enter_your_domain_here
[Groups]

[Rewrite]

[Statistics]
StatFlags:    0  # Statistical reporting settings
STF_Hours:    24  # How often to write stat log files
STM_Hours:    24  # How often to e-mail stat log files
Đặc biệt chú tâm đoạn code sau:


Code:
[MercuryC]
Host : smtp.gmail.com
Failfile : E:\XAMPP\xampp\MERCURYMAIL\Mercury\FAILURE.MER
HELO : JMB
Poll : 30
Scratch : E:\XAMPP\xampp\MERCURYMAIL\Mercury
ReturnLines : 15
Timeout : 30
ESMTP : 1
Server_Port : 465
SMTP_Username: mercurymailer@gmail.com
SMTP_Password: andmad
SMTP_ConnFlags : 8
POP3_Auth : 0
Log_Verbose : 0
Bạn có thể thay những thông số này bằng Gmail của bạn nếu cần.
Sau đó nhớ dùng XAMPP Controller start Mercury Mail (ở dưới cùng trong 4 cái), và thử các hàm mail.
Đây là hướng dẫn cơ bản, chi tiết hơn sẽ đến khi mình có nhiều thời gian hơn. Bạn nào có thời gian thì viết giúp hướng dẫn đầy đủ nhé.
Thân mến.

(Sưu tầm)
 

Facebook Comments

New posts New threads New resources

Back
Top