RSS

Send emails with multiple attachments using wordpress

25 Sep

// values are just samples…

$to = “$inq_email”;
$subject = “Form Inquiry”;
$headers = ‘From: John Martel ‘ . “\r\n”;
$target_path = array(WP_CONTENT_DIR . ‘/uploads/sample1.pdf’);
array_push($target_path, WP_CONTENT_DIR . ‘/uploads/sample2.zip’);

$message = “

Thank you {$inq_name} for your inquiry and we will contact you as soon as we reviewed your message.

“;

if(wp_mail($to, $subject, $message, $headers, $target_path)) { echo ‘email success’; } else { echo ‘did not send’; }

Advertisement
 

About john martel

Someday I'll fly. Someday I'll soar.
Leave a comment

Posted by on September 25, 2011 in Wordpress

 

Tags: , , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.