0

I would like to create a php script that sends data to Gmail whenever someone makes a purchase. I'm only looking to send couple variables, is there any way to do this?

<?php
$firstname = $_POST["firstname"];
$lastname = $_POST['lastname'];
$email = $_POST['emailaddress'];

// Send data to Gmail
?????

?>

If there's not a way to do this through PHP, what would be the best way? If Gmail is the best service to use for this, What would be the be third-party service?

I'm open to any suggestions, thank you.

Cristian
  • 341
  • 1
  • 4
  • 27
  • 1
    Are you trying to send a mail? – Tamilvanan Mar 18 '18 at 07:06
  • 2
    Check this out. https://stackoverflow.com/questions/14456673/sending-email-with-php-from-an-smtp-server if you have a gmail account you can use the google smtp service https://support.google.com/mail/answer/7126229?hl=en – M31 Mar 18 '18 at 07:07
  • 1
    You can send mails using php `mail()` function or with smtp service with `PhpMailer`. I have made a video on how to send with PHP mail: https://www.youtube.com/watch?v=_8PISnkumHI – csandreas1 Mar 18 '18 at 08:43

0 Answers0