Sending email – Mail Function in PHP

Almost in every web application sending automated email by system is the common requirement. So, it’s very common and important part that must be known by developer.

The simple example, when a visitor to your website fills out a enquiry form.

mail function return a boolen value, return true if email sent successfully, false otherwise

 Syntax:

mail ($to , $subject , $message, $additional_headers);

$to: This is the first parameter of mail function hold the email address of receiver, the address to which email has to be sent.

$subject: Every email should have subject. This parameter cannot contain any newline characters.

$message: This is the actual body or content of email to send.  Please note that every line should be break by \n and every line should not exceed the limit of 70 characters.

$addintional_header: This contain additional header values like From, CC or Bcc etc. This is the optional parameter in mail function.

 Example

<?php

$to = “info@websjyoti.com”;

$subject = “Welcome to Webs Jyoti”;

$txt = “Hi, You received a new enquiry from user. this is an automated mail”;

$headers = “From: sales@websjyoti.com” . “\r\n” ;

mail($to,$subject,$txt,$headers);

echo “Mail sent successfully”;

?>

About Us

Luckily friends do ashamed to do suppose. Tried meant mr smile so. Exquisite behaviour as to middleton perfectly. Chicken no wishing waiting am. Say concerns dwelling graceful.

Services

Most Recent Posts

  • All Post
  • advanced-excel-training
  • Branding
  • deepti saini model
  • Development
  • Digital Marketing
  • digital marketing course gurgaon
  • Digital Marketing Internship Gurugram
  • digital marketing jobs
  • digital-marketing-institutes-sector-14
  • Leadership
  • Management
  • Notice
  • php-development-courses
  • php-full-stack-development-courses
  • php-job-opportunity
  • php-training
  • php-training-in-baksar
  • php-training-in-balia
  • php-training-in-bangalore
  • php-training-in-delhi
  • php-training-in-faridabad
  • php-training-in-gaziabad
  • php-training-in-gorakhpur
  • php-training-in-gurgaon
  • php-training-in-kolkata
  • php-training-in-muzaffarpur
  • php-training-in-noida
  • php-training-in-patna
  • placements
  • web development training gurgaon

Company Info

She wholly fat who window extent either formal. Removing welcomed.

Limited Seats Available – Register Now

We keep batch sizes limited so every learner gets personal attention and proper doubt solving. Reserve your seat now and start your training in the next batch without delay. For details call us +91- 8802000175

Help

Privacy Policy

Terms

Conditions

Subscribe Now

For latest news and updates, fill your details below-

You have been successfully Subscribed! Ops! Something went wrong, please try again.
© 2023 Created with Royal Elementor Addons