PHP Script to send Email

PHP Script to send Email

Now a days PHP is most commonly used language for developing web applications and is also flexible, as it provides several features that reduces the human efforts and several programs can be made in PHP that would be responsive and will work automatically whenever required. Today, we will discuss about similar PHP applcation that is PHP Script to send email.


PHP Script to send email

There is a simple built in function in PHP for sending mails that is mail() function, this PHP function allows us to send mail to anyone on the internet.

PHP mail() Function

Here you will learn sending simple mail using PHP mail() function


Syntax of PHP mail() function

Here is the syntax of PHP mail() Function



  • To : Here you have to specify the Receivers email
  • Subject : Here subject of the email is specified.
  • message : In this part comes the main message which to want to mail to anyone.
  • header : It is optional part that can be used for specifying additional headers like cc, bcc from etc
  • parameters : It is optional and can be used for specifying some additional parameters to send mail program

NOTE - Minimum version of PHP 4 is required for using mail() function.



Example



This was all about PHP Script to send email, simply we have used mail function for sending mail. If you are facing some problem or want to share something you are free to comment below.

You may like - How to create Sessions in PHP

Previous
Next Post »

2 comments

Click here for comments
Unknown
admin
July 30, 2015 at 3:54 PM × This comment has been removed by a blog administrator.
avatar
Unknown
admin
August 7, 2015 at 7:01 PM × This comment has been removed by a blog administrator.
avatar