On my site I have two forms witch send email. The one with no attachment needed is sent correctly, but the other one which has an attachment does not get sent. I am using SMTP config with Postman SMTP plugin.
move_uploaded_file($_FILES["cv"]["tmp_name"],WP_CONTENT_DIR .'/uploads/CV/'.basename($_FILES['cv']['name'])); move_uploaded_file($_FILES["lm"]["tmp_name"],WP_CONTENT_DIR .'/uploads/lm/'.basename($_FILES['lm']['name'])); $attachments = array( WP_CONTENT_DIR ."/uploads/CV/".$_FILES["cv"]["name"], WP_CONTENT_DIR ."/uploads/lm/".$_FILES["lm"]["name"] );
This is the code I use for storing and reaching the attachments and simply using the wp_mail function to send it like this:
$sent=wp_mail($s, $subject, $message, $headers,$attachments);
On the other form I am using the same code just without the $attachments variable.
The one without attachments get sent but the other one does not. Can anyone help me find my problem?