MSMTP - Introduction
The majority of SMTP clients use the Windows registry. These are not suitable for portability. The Uniform Server XV uses the open source msmtp client. It's flexible, relatively easy to set up and, more importantly, it's portable. This page covers the configuration sub-menu, which allows you to configure and test the msmtp client.
- msmtp integrated client.
- Pre-configured configuration template file.
- Controller to set default account - Quick switching between accounts.
- Controller includes simple e-mail form for testing account configuration.
msmtp has been pre-configured and enabled in the PHP configuration files. msmtp itself uses a separate configuration file which has been pre-configured with example accounts. Before you can use PHP e-mail functions, you need to set up at least one account. Generally, this account is your ISP email account but, for portability, consider setting up a free email account such as Hotmail or Gmail.
Only one account (the default account) is active at any one time. The Uniform Server allows you to easily switch between the accounts you have configured and set one of these as the default account. After selecting an account, you can test it using the built-in email tester.
Edit MSMTP Configuration
msmtp is configured via the msmtprc.ini file. This has been pre-configured with four account skeletons (MyISP, Hotmail, Gmail and Yahoo). You can add as many accounts as you like, but each must have a unique account name.
Open this file either by using UniController or by directly using a text editor.
General > Mail utility msmtp > Edit Configuration File Button
There are four pre-configured account skeletons (MyISP, Hotmail, Gmail and Yahoo). You can add as many as you like, but each must have a unique account name.
The pre-configured accounts are templates. You must change the following for at least one account and assign it as the default.
- Substitute smpt.tiscali.co.uk with your ISP's smpt server
- Substitute firstname.lastname@example.org with your real email address
- Substitute email@example.com with your login email address
- Substitute fred123 with your login password
- Substitute firstname.lastname@example.org with your login email address
- Substitute fred999 with your login password
- Substitute email@example.com with your login email address
- Substitute mypassword with your login password
- Change account default : MyISP with the account name you want to use
Note 1: To relay via Hotmail, you will need to regularly log in to your account.
Note 2: PHP will use whichever account you have assigned as default, which is currently set to MyISP.
# 1 === Your ISP account ========================
# 2 === A freemail account at Hotmail ===========
# 3 === A freemail account at Google ============
# 4 === A freemail account at Yahoo ============
#==== Set a default account =====================
account default : MyISP
You can manually edit the configuration file msmtprc.ini and set the default account, or alternatively use UniController’s sub-menu:
General > Mail utility msmtp > Select Default Account Drop-down menu
This is a dual-purpose menu allowing you to set a default account and send a test email using this account.
Set Default Account
- Click the drop-down menu (2).
This displays all accounts contained in the configuration file.
- To set a default account, click an account name.
Note 1: PHP will use whichever account you have assigned as default, which is currently set to MyISP.
Note 2: With more than one account configured, you can easily select a default.
Note 3: The drop-down menu for selecting a default account lists all accounts in the configuration. You probably will want to delete any accounts you have not configured.
Send Test E-Mail
General > Mail utility msmtp > MSMTP send test e-mail Section
This is a dual-purpose menu, allowing you to set a default account and send a test email using this account.
Send Test Email
- Enter recipient's email address (3).
- Optionally, enter a subject or use default (4).
- Optionally, enter a message (5).
- Click Send Email button (6).
General > Mail utility msmtp > Log file Section
The menu provides a convenient way for you to view the msmtp log file. If you are experiencing problems sending e-mails, this should be your first port of call; it may shed light on a particular issue.
An example of the log content is shown on right. There are three lines which have been split to fit this web page.
Log file: UniServerZ\core\msmtp\msmtp.log
Feb 04 14:07:10 host=smtp.gmail.com tls=on auth=on firstname.lastname@example.org
email@example.com firstname.lastname@example.org mailsize=117
smtpstatus=250 smtpmsg='250 2.0.0 OK 1265292428 7sm2124401eyg.17'
Sep 22 14:08:53 host=smpt.tiscali.co.uk tls=off auth=off
email@example.com firstname.lastname@example.org mailsize=108
smtpstatus=250 smtpmsg='250 ok: Message 497320898 accepted'
Jan 24 11:12:14 host=smtp.live.com tls=on auth=on email@example.com
firstname.lastname@example.org email@example.com mailsize=100
smtpstatus=250 smtpmsg='250 2.6.0 <BLU0-SMTP9@BLU0-SMTP9.blu0.hotmail.com>
Queued mail for delivery' exitcode=EX_OK
Where to go next
See the next page for more details: msmtp - Detail