Control panel
Webmail


Back

Example: Sending mail
Here is an example of using PHP mail-function.

Programming:
<?
//recipient emailaddresse
$modtager = 'peter@somedomain.com';

$sender_name = 'Robot - yourdomain.com';
$sender_email = 'robot@yourdomain.com';

//mail header
$headers = 'From: "'.$sender_name.'"
Reply-To: "'.$sender_name.'" ;
X-Mailer: PHP/'.phpversion().';
Content-Type:text/plain; charset="iso-8859-1";';

//message
$message = 'This mail is sendt with PHP';

//emne
$subject = 'mail subject';

//sending mail
mail($modtager, $subject, $message, $headers);

?>

Note:
Be sure not to make a script where mail-recipient is sent with a get-variable. This is a target for spammers.

Further reading can be found here:

http://php.net/manual/en/function.mail.php