Here’s a quick way to send an email. You only need one line for that. I always use this script to send an alert on any event triggered. Let say somebody just make a payment on your site.
$headers = "From: sendername <firstname.lastname@example.org>\r\n"; $headers .= 'Cc: email@example.com' . "\r\n"; $headers .= 'Bcc: firstname.lastname@example.org' . "\r\n"; $headers .= "Reply-To: email@example.com\r\n"; $headers .= 'MIME-Version: 1.0' . "\r\n"; mail('firstname.lastname@example.org','Subject','Message',$headers);
For the “from” email, some hosting requires you to use only registered email address in your hosting/domain.