-1

I am beginner to php and ajax. Could you please help me how to send an email using php. Your help will be much appreciated. Thanks in advance.

Below is my required.

Logged in user details to AC Dealers and dealers content to logged in user.

The below image content should sent to logged in user details to the AC Dealer email id. enter image description here

David Gölzhäuser
  • 3,525
  • 8
  • 50
  • 98
  • 1
    I think we need a bit more info. So you just want to send an Email in php with some text to a specific recipient? – David Gölzhäuser Nov 18 '17 at 10:44
  • @DavidGölzhäuser. yes exactly ..for example: if john is logged in and he seeing dealers data .john details need to send to dealers email ..and which the data has john has seen that should need to send to john email. – sai reddy Nov 18 '17 at 10:53
  • I hope my answer helped you! – David Gölzhäuser Nov 18 '17 at 16:34
  • Possible duplicate of [How to send an email using PHP?](https://stackoverflow.com/questions/5335273/how-to-send-an-email-using-php) – sam-pyt Dec 16 '17 at 02:20

1 Answers1

0

Well, sending an Email in PHP is pretty easy.

Sending from the server to an recipient:

$recipient = "dealer@market.com";
$subject = "This is a very important subject";
$message = "This is the Email body with your data";
mail($recipient, $subject, $message);

Sending from a specific Email to an recipient

$recipient = "dealer@market.com";
$subject = "This is a very important subject";
$message = "This is the Email body with your data";
$header = "From: John Doe <john.doe@email.com>";
mail($recipient, $subject, $message, $header);

You can find the documentation here.

David Gölzhäuser
  • 3,525
  • 8
  • 50
  • 98