Categories: eLearning

Send Email using PHP – TechnoGripper India

Today, TechnoGripper India comes with an example to send email using PHP Script. For sending emails, PHP must be configured perfectly in php.ini file.

In PHP, You can send an email by using predefined PHP Function – mail(). This function needs 3 mandatory arguments that include the receiver’s mail id, a subject for the mail and the actual message content of the mail additionally there are two more variables that are non-mandatory.

Here are details of all the five functions:
to: Receiver Email ID
subject: Subject Line of the Email Message
message: Defines the message content to be sent to the Email
headers: Specifies additional headers, like From CC, BCC. Or if you want to send HTML email then also you need to use headers as a parameter. It should be CRLF separated
parameters: Specifies an additional parameter to send email using mail()

Here is Syntax to Send Email using PHP:

$to = ",";
$subject = "Send Email using PHP";

$message = "
<title>HTML Message Content</title>
 <p>This email contains HTML Tags!</p>

// Always set content-type when sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";

// More headers
$headers .= 'From: XXXX XXXX<>' . "\r\n";
$headers .= 'Cc:' . "\r\n";


If your script sent email successfully then the function mail() returns true otherwise it will return false.

That’s All to Send Email using PHP.
Any Query, Send us an Email at We are always there to help volunteers and passionate peoples.

Recent Posts

Mistakes of Entrepreneurs: Deadly Mistakes of Entrepreneurs

The mistakes of entrepreneurs can be one of the costliest mistakes. Not only it can cost your business, but it…

4 days ago

Top Young Entrepreneurs from India, you must know about

Today, We'll featuring top young entrepreneurs from India, who have actually inspired entrepreneurs across the world. India has one of…

1 week ago

नए उद्यम विकास को प्रभावित करने वाले कारक।

भारत में उद्यमिता विकास  को प्राभावित करने वाले कारण निम्न हैं। जैसे : -  आर्थिक, सामाजिक और सांस्कृतिक , मनोवैज्ञानिक,…

1 month ago

उद्यमियों (एंटरप्रेन्योर) के लिए कौन सी योजना उपलबध है

भारत सरकार ने हमेशा से ही उद्योग के क्षेत्र को बढ़ावा देने की कोशिश की है. देश में उद्यमियों की…

2 months ago

उद्यमियों ( एंटरप्रेन्योर ) के लिए वैश्विक समस्या क्या है

किसी भी देश में आर्थिक विकास की गति को बढ़ावा देने तथा व्यावसायिक समस्याओं का समाधान करने में उद्यमी की…

2 months ago

Cocofit Has Raised INR 5 Crores From Shark Tank India

The shark tank India startup Cocofit has raised an unconventional amount of 5 rupees for the equity of 5% from…

2 months ago


WEXT India Ventures

C-22, Sector 65, Noida, Uttar Pradesh – 201301

Corporate Queries:

Mobile: +91 956 085 0036

Advertisement Queries:

Mobile: 956 085 0036