Webhosting platform

Hosting powered by RESTENA

Sending e-mail via PHP or CGI scripts

You can send e-mails from PHP pages as well as from CGI scripts. In both cases the e-mails are handled by /usr/bin/sendmail, e-mails are transmitted to the outgoing mail server which will forward them to the right destinations.

The relay server only accepts authenticated connections, the authentication is based on the FTP login and a password shared with the outbound proxy.

/usr/bin/sendmail reads its configuration (relay server, authentication credentials) from .msmtprc located in your FTP root. The file looks like the one below:

account default
 domain w3.restena.lu
 host smtp-server.restena.lu

 syslog LOG_MAIL
 logfile ~/.msmtp.log

 from webmaster@your-site.lu
 auth plain
 user <FTP login>
 password <proxy password>

Except deletion of .msmtprc or password change, you should not worry about this configuration file, it is initialized by our own.

You can send e-mail from SSH access the same way as for PHP pages or CGI scripts, the command to run being: sendmail <destination@example>, the mail content including headers are taken from stdin.