Category

How to get an Array onto your email in WordPress?

Here is the simple snippet of code that can help you achieve this:

$headerstext = array(‘Content-Type: text/html; charset=UTF-8’); // just for getting it as html email
$message = “Coupon List: ” . print_r( $yourarray, true ); //replace $yourarray with your array
wp_mail(‘[email protected]’, ‘Coupon List’, $message,$headerstext); //replace email with yours

Note: Do check your SPAM folder.