How to send emails and use php-mail and now perl-mail from your asus:
precondition: installation according wengi's howto. Further an extra email account with any provider. The provider must have a regular mailserver. Please ensure, that all account datas are available.
If you want to use emails with php and/or perl, you need a wengi installation and install your webserver, mysql and php according wpte's howto.
WinSCP, Putty, mc or nano or vi is called editor
Preamble: in this howto we use esmtp. I never had success with sendmail. But esmtp has a aquivalent sendmail syntax, so we can use it for everything.
It is very easy to install and easy to use, even for multiple accounts.
For more informations just google....
INSTALLATION:
Code:
ipkg update
ipkg install esmtp
touch /opt/etc/esmtprc
vi /opt/etc/esmtprc #switch to insert mode
identity accountname@testdomain.com
hostname smtpserver.testdomain.com:25
username "accountname@testdomain.com"
password "accountpassword"
#save the file
cd /tmp/local/root
touch email
vi email #switch to insert mode
date: 29.05.2011
to: anyemailname@domain.com
subject: Test-email
from: accountname@testdomain.com
This is a testmail from the asus router
#save the file
esmtp -t < email
The identity is your new account which you must have.
The hostname must be a valid smtp server of your/any provider.
The username is your accountname (usually your email-name)
Password is your password of you emailaccount.
The used emailaddress (anyemail@domain.com) in file email must be a valid address.
Check that you have received your email
Consider, this way you can send for instance your logfile daily with the help of cron.
Or you can install a simple to use reminder system.
Further, you can use your esmtp-mail as default mailsystem with PHP.
Just to show you, how you can use your mailsystem you will find some script-code for your shell below as well as how to configure PHP and php tests.
Further, you will find now a short introduction of using perl-mail with a perl test page.
Have fun