Telenet Cloud Online Help

How do I send mail from my website using PHP?

You can send emails directly from your PHP website hosted on your shared Linux (Apache) package. Below you can find a sample code to do so. As “From” address you fill in an email address of your own domain name f.i. webmaster@your-domain.be.

$to = ’nobody@example.com’;
$subject = ’the subject’;
$message = ’hello’;
$headers = ’From: webmaster@example.com’ . " " .
’Reply-To: webmaster@example.com’ . " " .
’X-Mailer: PHP/’ . phpversion();

mail($to, $subject, $message, $headers, ’-f webmaster@example.com’);
?>

3.67 (3)
Article Rating (3 Votes)
Rate this article
Attachments
There are no attachments for this article.
Related Articles
Where can I find the PHP manual?
Viewed 1467 times since Tue, Nov 18, 2008
How does the connection between PHP and MSSQL work?
Viewed 3353 times since Mon, Jul 23, 2012
Install Joomla 2.5
Viewed 10951 times since Mon, Apr 30, 2012
Which PHP version is installed on the server? Which modules are available?
Viewed 2693 times since Tue, Nov 18, 2008
How do I recognize PHP pages/scripts?
Viewed 2513 times since Tue, Nov 18, 2008
How do I track problems in my PHP website?
Viewed 2129 times since Fri, Jan 21, 2011
Is ionCube Encoder/Loader supported?
Viewed 1715 times since Thu, Jul 19, 2012
Is Zend Engine supported?
Viewed 2770 times since Mon, Jul 23, 2012
Can I use PHP on IIS 7 (Windows hosting)?
Viewed 1656 times since Tue, Nov 18, 2008
Is Zend Guard/Optimizer supported?
Viewed 1116 times since Mon, Jul 23, 2012