Skip to content

Instantly share code, notes, and snippets.

@asterion
Last active June 28, 2017 17:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asterion/c1b84d2ddcb07928809ccc3d618c0b12 to your computer and use it in GitHub Desktop.
Save asterion/c1b84d2ddcb07928809ccc3d618c0b12 to your computer and use it in GitHub Desktop.
Envio de email usando wp, prueba.
<?php
$uploaddir = trim(ABSPATH, '/') . DIRECTORY_SEPARATOR . 'uploads' . DIRECTORY_SEPARATOR;
$attachments = [];
foreach ($_FILES as $i => $data) {
$uploadfile = $uploaddir . basename($data['name']);
if (move_uploaded_file($data['tmp_name'], $uploadfile)) {
$attachments[$i] = $uploadfile;
}
}
wp_mail($conReceptor,$conAsunto,$conMensaje, $attachments, array( 'Reply-To: '.$conNombre.' <'.$conCorreo2.'>'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment