Nigel Whitworth's Development Site

You are currently not logged in.

How do I send an email using PHP?

Sending email from PHP is a lot easier than having to send email via ASP. With PHP, you simply use the mail command, its format is below :-

     mail(TO,SUBJECT,MESSAGE,FROM);

An example is below :-

     mail('AUser@AnUnbelievablyLongWebSiteAddress.com','Demo Email','Just thought I'd say hello.','From: Admin@(YourSite)');

It won't fake an email address so don't try replacing (YourSite) with say Microsoft.com.


If you intend to vote or make a comment, please enter the security code.

Make a comment

*Comments are the views of individuals, they may or may not be correct.
All comments are reviewed and accepted or rejected.
If you give an email address, you will be sent an email when someone makes a comment on this page.*

Name :
Email :
Comments :


Only name and Code is compulsory.
 
 
Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)