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 <email@example.com>\r\n"; $headers .= 'Cc: firstname.lastname@example.org' . "\r\n"; $headers .= 'Bcc: email@example.com' . "\r\n"; $headers .= "Reply-To: firstname.lastname@example.org\r\n"; $headers .= 'MIME-Version: 1.0' . "\r\n"; mail('email@example.com','Subject','Message',$headers);
For the “from” email, some hosting requires you to use only registered email address in your hosting/domain.